Advertisement
dkyoseff

Conditional Statements - Lab / 06. World Swimming Record

Jul 11th, 2022
799
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. import math
  2.  
  3. record_seconds = float(input())
  4. distance_metres = int(input())
  5. time_seconds_perminute = float(input())
  6.  
  7.  
  8. contest = distance_metres * time_seconds_perminute
  9.  
  10. set = math.floor(distance_metres / 15)
  11.  
  12. set2 = set * 12.5
  13.  
  14. sum_time = contest + set2
  15.  
  16. if record_seconds <= sum_time:
  17.     result = sum_time - record_seconds
  18.     print(f"No, he failed! He was {result:.2f} seconds slower.")
  19.  
  20. elif record_seconds > sum_time:
  21.     print(f"Yes, he succeeded! The new world record is {sum_time:.2f} seconds.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement