I have to write a program that converts user entered Kilometers into Miles. But, I need to use two functions in addition to main program which is...
def main():
print "This program converts distances measured in kilometers to miles."
kilometers = input("What is the distance in kilometers?")
miles = kilometers * .62
print "The distance in miles is", miles
main()
The first function should ask for the kilometers driven and return them to the main program. The second function should receive the kilometers driven from the main program, calculate the miles driven and display them.
This is what I have, but I don't think it's right with the specifications. I need some help!
def kilo():
#variable name type purpose
#kilometers float distance in kilometers
kilometers = input("What is the distance in kilometers?:")
return kilometers
def miles():
#variable name type purpose
#miles float calculate distance in miles
miles = kilo() * .62
return miles
def main():
print "This program converts distances measured in kilometers to miles."
print miles()
main()