Question: 5 . 3 8 LAB: Track laps to miles One lap around a standard high - school running track is exactly 0 . 2 5
LAB: Track laps to miles
One lap around a standard highschool running track is exactly miles.
Define a function named lapstomiles 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 lapstomiles to calculate the number of miles,
and outputs the number of miles returned from the function.
Output each floatingpoint 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:
the output is:
Ex: If the input is:
the output is:
LAB
ACTIVITY
: LAB: Track laps to miles
main.py
Load default template...
#lapstomiles function
def lapstomilesuserlaps:
#convert userlaps to miles and return result
return userlaps
#take input from user
userlaps floatinput
#call lapstomiles and store returned result in miles
miles lapstomilesuserlaps
#print result
nnint fi millocll
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
