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

Rafael Knuth rafael.knuth at gmail.com
Tue Nov 26 18:02:43 CET 2013


> OK, That's what you'd expect in 3.3 because raw_input is now input().
>
> But in that case input() should not do anything with your input.
>
> Can you post a session showing the input and the odd behaviour?

YourName = input(str("What is your name ?"))
print("Hello", YourName)

Exemplary input & output:

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600
64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
What is your name? for
Hello for
>>>

Color of for is changed to orange on the input line ("What is your name?")

Raf


>
>
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.flickr.com/photos/alangauldphotos


More information about the Tutor mailing list