I wrote this code but my instructor said that the program should loop for new input until told to stop by the person running the program.
*hint: an input of zero (0) kilometers could be used to stop the program.
Can someone show me how to include that in my code? I used x=raw_input(), since it closes so fast in cmd when I ran the program.
def kilo():
kilometers = input("Please enter a distance in kilometers?:")
return kilometers
def miles(km):
"""calculates miles from kilometers km"""
miles = km * 0.6214
return miles
def main():
print "This program converts kilometers to miles."
km = kilo()
print miles(km)
main()
x= raw_input()