On 26/11/13 16:15, Rafael Knuth wrote:
YourName = input(str("What is your name?"))
print("Hello", YourName)
When executing the program, in case the user input is "for", "not",
"True", "while" Python interprets that as a command
Sounds like you are using Python v2.
You need to yuse raw_input() instead of input().
In Python v3 the old input was removed and raw_input
renamed to input()
Are you by any chance reading a v3 tutorial but using v2?
BTW the str() in
> YourName = input(str("What is your name?"))
does nothing since "What is your name?" is already a string
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor