Advertisement
Spocoman

Running In The Park

Sep 24th, 2023
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. total_minutes = 0
  2. total_distance = 0
  3. total_calories = 0
  4.  
  5. n = int(input())
  6.  
  7. for i in range(n):
  8.     day_minutes = int(input())
  9.     day_distance = float(input())
  10.     distance_unit = input()
  11.     if distance_unit == "m":
  12.         day_distance *= 0.001
  13.  
  14.     total_minutes += day_minutes
  15.     total_distance += day_distance
  16.     total_calories += int(day_minutes * 400 / 20)
  17.  
  18. print(f"He ran {total_distance:.2f}km for {total_minutes} minutes and burned {total_calories} calories.")
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement