anonymous
2011-06-20 12:44:15 UTC
#Intro
print "Welcome!"
print "Press 1 for Celsius to Fahrenheit, or Press 2 for Fahrenheit to Celsius."
z=raw_input("1 or 2: ")
if z=="1":
x = input("Enter Celsius: ")
y = (float(x)*1.8)+32
print "It is ", y, "Fahrenheit."
while 1:
x = input("Enter Celsius: ")
y = (float(x)*1.8)+32
print "It is ", y, "Fahrenheit."
elif z=="2":
b = input("Enter the fahrenheit: ")
c = (float(b)-32)*(5.0/9.0)
print "It is ", c, "celsius."
while 1:
b = input("Enter the fahrenheit: ")
c = (float(b)-32)*(5.0/9.0)
print "It is ", c, "celsius."
And how do I create an option to quit either 1 or 2. I have only 3 days studying and writing codes in python PLEASE help! Revise my code please and correct it plz!! What's wrong with elif!?!!?!?!?!?!?