'''lecture_09_mpg.py Calculates and makes a decision about a car's MPG Oliver W. Layton Lecture 09 CS151: Computational Thinking: Visual Media Fall 2020 ''' def computeMPG(miles, gasUsed): '''Calculate miles-per-gallon, given miles traveled and gallons used''' mpg = miles / gasUsed return mpg # return 30.0 def goodMileage(mpg): '''Report how good the gas mileage as miles-per-gallon is''' if mpg > 50: print(mpg, 'mpg is great gas mileage!') elif mpg >= 30: print(mpg, 'mpg is pretty good gas mileage.') # goes in here elif mpg >= 20: print(mpg, 'mpg is acceptable.') else: print('The gas mileage is not great!') # main code # Calculate the MPG of our trip and determine how good it is miles = 300 tank = 10 myMPG = computeMPG(miles, tank) # computeMPG(300, 10) -> replaced with 30.0 # now in main table we have entry: [myMPG 30.0 float] # Then function symbol table goes away... goodMileage(myMPG) # goodMileage(30.0)