[Tutor] Issue w/ string input "for", "not", "while", "else" etc.

Rafael Knuth rafael.knuth at gmail.com
Wed Nov 27 09:54:16 CET 2013


Thank you, Peter!

On Wed, Nov 27, 2013 at 9:45 AM, Peter Otten <__peter__ at web.de> wrote:
> Rafael Knuth wrote:
>
>> simple issue I couldn't find a solution for:
>>
>> 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 and changes the
>> input's color to the corresponding command. The program runs without
>> any further issues, but I was wondering: How can I make sure Python
>> "understands" that the user input is nothing else but a string? I
>> tried to fix that by changing input("What is your name?") to
>> input(str("What is your name?)) but that didn't work.
>>
>> Thanks in advance,
>
> I took the freedom to report it myself:
>
> http://bugs.python.org/issue19808
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list