B
braden faulkner
I'm using a menu for my command line app using this method.
choice = "foobar"
while choice != "q":
if choice == "c":
temp = input("Celsius temperature:")
print "Fahrenheit:",celsius_to_fahrenheit(temp)
elif choice == "f":
temp = input("Fahrenheit temperature:")
print "Celsius:",fahrenheit_to_celsius(temp)
elif choice != "q":
print_options()
choice = raw_input("option:")
Just wondering if there is another or more efficient way I should be doing it?
Thanks
-- Braden Faulkner
choice = "foobar"
while choice != "q":
if choice == "c":
temp = input("Celsius temperature:")
print "Fahrenheit:",celsius_to_fahrenheit(temp)
elif choice == "f":
temp = input("Fahrenheit temperature:")
print "Celsius:",fahrenheit_to_celsius(temp)
elif choice != "q":
print_options()
choice = raw_input("option:")
Just wondering if there is another or more efficient way I should be doing it?
Thanks
-- Braden Faulkner