Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

15-5 How will MIS help my career?

Answered: 1 week ago