Learning Python

Alex Martelli aleaxit at yahoo.com
Sun Feb 5 12:07:50 EST 2006


Byte <eoinrogers at gmail.com> wrote:

> http://docs.python.org/tut/node6.html#SECTION006100000000000000000

I think you're confusing the tutorial's use of:

 int(raw_input(...  

which means "get a string from the user and turn it into an integer" (a
very common idiom), with your use of:

 input(raw_input(... 

which means "get a string from the user and use it as a prompt to get
any value from the user" (a very peculiar usage).

The difference between `int' and `input' is rather enormous.


Alex



More information about the Python-list mailing list