""" John Rachlin File: travel.py Description: How long did it take me drive to Arizona? distance [mi] = speed [mi/hr] X time [hr] time [hr] = distance [mi] / speed [mi/hr] Boston to Arizona: 2637 miles John drove: 90 miles per hour """ # We'll talk about "main" next week. # It basically identifies the starting point for our code. # This is especially useful when the program contains many lines of code def main(): # inputs distance_mi = float(input("Enter distance [mi]: ")) speed_mph = float(input("Speed [mi/hour]: ")) # compute travel time (hours) time_hr = distance_mi / speed_mph print("Travel time: ", round(time_hr, 2), "hours") # convert to days, rounded to two decimal places time_days = time_hr / 24 print("Travel time: ", round(time_days, 2), "days") main() # Call the main function - start the code running!