''' Purpose: use programmer-defined functions from module uva ''' import uva # get access to module being tested # test credits_to_go() reply = input( "Enter credits earned: " ) credits_earned = int( reply ) # Here's what the user supplied. credits_needed = uva.credits_to_go( credits_earned ) # Pass in argument credits_earned! # credits_earned replaces the parameter n. credits_earned is the ARGUMENT # with the explicit value to replace the placeholder parameter n in the function # definition! If the user types 18, reply = '18', credits_earned is 18 print( "credits_to_go(", credits_earned, "):", credits_needed ) print() # test how_old_is_UVA() age = uva.how_old_is_UVA() print( "how_old_is_UVA():", age ) # test grade_as_percent( right, total ) reply = input("Enter right and total: ") # If I enter '61 100' right, total = reply.split() # '61', '100' right, total = int( right ), int( total ) # 61, 100 # Pass it into the function # IMPORTANT # variable = function call = function( arguments ) # variable stores the result of the function call! # pct stores the return value of the function call! pct = uva.grade_as_percent( right, total ) # pass in arguments right and total into function print( pct ) # If we didn't return the string of percent%, we could've done print(pct,'%')