Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Quizzma Latest Articles

3.6.8 Running Speed CodeHS Answers

We thoroughly check each answer to a question to provide you with the most correct answers. Found a mistake? Tell us about it through the REPORT button at the bottom of the page. Ctrl+F (Cmd+F) will help you a lot when searching through such a large set of questions.

The most common answer is:

Enter your code here
miles= float(input(“How many miles did you run?”))
minutes= float(input(“How many minutes did it take you?”))
MINUTES_PER_HOUR = 60
mPH = MINUTES_PER_HOUR * miles / minutes
print(“Speed in MPH: ” + str(mPH))

To ensure your code runs correctly and adheres to Python syntax, particularly using standard ASCII quotation marks and correcting the formula for calculating miles per hour, here’s the revised version of your program:

# Ask the user for the number of miles run and the time it took
miles = float(input("How many miles did you run? "))
minutes = float(input("How many minutes did it take you? "))

# Define a constant for the number of minutes in an hour
MINUTES_PER_HOUR = 60

# Calculate the running speed in miles per hour
mPH = miles / (minutes / MINUTES_PER_HOUR)

# Print the calculated speed in MPH
print("Speed in MPH: " + str(mPH))

This corrected version accurately calculates the running speed in miles per hour (MPH) by dividing the total miles run by the total time in hours (converted from minutes).

Was this helpful?




Quizzma Team

Quizzma Team

The Quizzma Team is a collective of experienced educators, subject matter experts, and content developers dedicated to providing accurate and high-quality educational resources. With a diverse range of expertise across various subjects, the team collaboratively reviews, creates, and publishes content to aid in learning and self-assessment.
Each piece of content undergoes a rigorous review process to ensure accuracy, relevance, and clarity. The Quizzma Team is committed to fostering a conducive learning environment for individuals and continually strives to provide reliable and valuable educational resources on a wide array of topics. Through collaborative effort and a shared passion for education, the Quizzma Team aims to contribute positively to the broader learning community.

Related Posts

Leave a comment