167k views
3 votes
One lap around a standard high-school running track is exactly 0.25 miles. Write a program that takes a number of miles as input, and outputs the number of laps.

User Cyril
by
8.4k points

1 Answer

2 votes

miles = float(input("Enter the number of miles: "))

laps = miles / 0.25

print("Number of laps:", laps)

Step-by-step explanation:

Prompt the user to enter the number of miles as a float value using the input() function.

Calculate the number of laps by dividing the number of miles by 0.25, since one lap in this scenario is 0.25 miles.

Finally, use the print() function to output the number of laps.

User Scorpil
by
8.3k points