Description Running 011 a particular treadmill you burn a certain number of calo
ID: 3671679 • Letter: D
Question
Description Running 011 a particular treadmill you burn a certain number of calories per minute (first user input). Write a program that uses a loop to display the number of calories burned after every 5 minute interval for a certain duration (second user input). Filename Specification: The solution for this problem must be coded in a file named two.py Input Specification: The first input (a float number) must use the prompt "Enter calories burned per minute " and the second input (an uif number) must use the prompt "Enter duration of exercise 111 minutes: Output Specification. The output should be present in a two-column format with.1 tab space between the two columns (see sample interaction below). The output should be done after all 5 minute intervals that fit within the exercise duration. E g. in the sample below, duration is IT and the intervals marked by 5. 10, 15 arc shown, leaving out the remaining 2 minutes at the end of the duration.Explanation / Answer
Please provide the output format sample as mentioned in the question.I have implemented the solution but if you need any modification in output format please comment on the answer with the output format.
two.py
print("Enter calories burned per minute")
cal=input()
#input taken is string by default,converting it to float for further calculations
calories_rate=float(cal)
print("Enter duration of exercise in minutes")
duration=input()
#input taken is string by default,converting it to int for further calculation
ex_duration=int(duration)
print("%s %s"%("Minutes","Calories Burned"))
print("------------------------------")
calories=0
for i in range(5,ex_duration,5):
calories=calories+calories_rate*5
#formatting the output in two columns with a tab space
print("{0:>5d} {1:>10f}".format(i,calories))