[Tutor] input command

alan.gauld@bt.com alan.gauld@bt.com
Wed, 22 Dec 1999 17:47:57 -0000


> I am very new at this so please bear with me.
> 
> When I try the "input" command it seems to automatically 
> print when I try to 
> go to the next line. 

input is for numbers only! You may need raw_input()...

But it sounds like you are typing this in the interactive 
prompt mode. You probably need to type your program into 
a separate file and then run that from the Unix/DOS prompt 
like:

C:>python myprog.py

Visit my tutor and look at the 'Talking to the user' and
'modules and functions' sections...

http://members.xoom.com/alan_gauld/tutor/tutindex.htm

If you really want to do it from the interactive prompt, 
simply type in your value and hit return. This will return 
you to the >>> where you can carry on inputting your program. 
The value you entered will be stored in 'a'.

Thus:

>>>a = input ("Hit it: ")
Hit it: 12
>>>print a
12
>>>

Alan G.