Question: How would you use Python to figure out mph if you had written other code to put inputs of how many miles driven and how

How would you use Python to figure out mph if you had written other code to put inputs of how many miles driven and how many hours driven?

Below is what I have so far. When I try to do the calculation, it says there is an error on the string or float (that is not included). The last step is to write "You averaged [mph] on your trip" where the value in the brackets is the variable. It's supposed to give you the answer once the program prompts inputs when it is run but I get errors. How do I approach this?

# Part 1 - Average miles per hour on your trip miles = input("How many miles did you drive?") miles = float(miles) print("Miles driven:", miles)

#Prompt the user for hours driven hours = input("How many hours did you drive?") miles = float(hours) print("Hours driving:", hours)

"You averaged [mph] on your trip"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!