Question: 5 . 3 8 LAB: Track laps to miles One lap around a standard high - school running track is exactly 0 . 2 5

5.38 LAB: Track laps to miles
One lap around a standard high-school running track is exactly 0.25 miles.
Define a function named laps_to_miles that takes a number of laps as a parameter, and returns the number of miles using the constant above.
Then, inside if == main test (given)
get the number of laps as an input,
call the function laps_to_miles () to calculate the number of miles,
and outputs the number of miles returned from the function.
Output each floating-point value with two digits after the decimal point, which can be achieved using a format specifier (%) in your print statement.
Ex: If the input is:
7.6
the output is:
1.90
Ex: If the input is:
2.2
the output is:
0.55
539078.3140466.93zqy7
LAB
ACTIVITY
5.38.1: LAB: Track laps to miles
210
main.py
Load default template...
1 #laps_to_miles function
def laps_to_miles(user_laps):
#convert user_laps to miles and return result
return user_laps *0.25
#take input from user
user_laps = float(input())
8 #call laps_to_miles() and store returned result in miles
9 miles = laps_to_miles(user_laps)
10 #print result
11 nnint 10%2fi 9 millocll
 5.38 LAB: Track laps to miles One lap around a standard

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!