Learning Modules, Arguments, Parameters (imma noob)

codywcox at gmail.com codywcox at gmail.com
Thu Sep 24 14:45:06 EDT 2015


I seem to be having a problem understanding how arguments and parameters work, Most likely why my code will not run. 
Can anyone elaborate on what I am doing wrong?

'''
Cody Cox
9/16/2015
Programming Exercise 1 - Kilometer Converter
Design a modular program that asks the user to enter a distance in kilometers and then convert it to miles
Miles = Kilometers * 0.6214
'''

def main():
   get_input()
   convert_kilo()


 def get_input(kilo):
   kilo = float(input('Enter Kilometers: '))
   return kilo

 def convert_kilo(kilo,miles):
     miles = float(kilo * 0.6214)
     print( kilo,' kilometers converts to ',miles,' miles')

 main()



More information about the Python-list mailing list