[Tutor] raw_input

Hee-Seng Kye kyeser at earthlink.net
Sat Jul 10 02:13:24 CEST 2004


Is there a way to make 'raw_input' accept multiple arguments?  For 
example, I wrote this short program which converts temperature to C or 
F, but I have to enter the temperature and the conversion on two 
separate lines:

% python conv.py
Enter temperature: 30
Is this in C or F?: C
86.00 F

I did this by doing:
temp = raw_input("Enter temerature: ")
conv = raw_input("Is this in C or F?: ")

How would I be able to enter these two arguments in one line?  Like:

% python conv.py
Enter temperature: 30 C
86.00 F

Thanks for your help!



More information about the Tutor mailing list