Rafael Knuth wrote:

> Hej there,
> 
> 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,

Are you running the program inside idle? The (in this case unwanted) syntax 
highlighting is a feature of idle's shell. 

You could try and make a feature request on <http://bugs.python.org> for 
smarter colouring.


_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to