id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav1780@gmail.com 01_variables_and_operators > return_speed
prev  |  next  |  chance

Define a function that when passed three floating-point values, the first representing distance between two locations, the second representing the average speed of one-way trip, and the third representing the required average speed of the entire return-trip, returns the speed at which you must return to achieve the expected overall average. For example, if A and B are 60 kms apart, you travel from A to B @ 30kmph, and the overall average speed should be 40kmph, then you must return from B to A @60kmph. We will let you work out the math.


return_speed(60, 30, 40) → 60.0
return_speed(100, 80, 90) → 102.85714285714285
return_speed(12, 9, 5) → 3.4615384615384612

...Save, Compile, Run (ctrl-enter)

def return_speed(distance, to_speed, required_overall_speed):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 1 Post-solution available

Copyright Nick Parlante 2017 - privacy