Advertisement
veronikaaa86

06. World Swimming Record

Sep 18th, 2022 (edited)
1,464
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 1 0
  1. import math
  2.  
  3. world_record_sec = float(input())
  4. distance = float(input())
  5. time_in_sec_m = float(input())
  6.  
  7. all_time_sec = distance * time_in_sec_m
  8. delay = math.floor(distance / 15) * 12.5
  9. total_time_with_delay = all_time_sec + delay
  10.  
  11. if world_record_sec <= total_time_with_delay:
  12.     diff = total_time_with_delay - world_record_sec
  13.     print(f"No, he failed! He was {diff:.2f} seconds slower.")
  14. else:
  15.     print(f"Yes, he succeeded! The new world record is {total_time_with_delay:.2f} seconds.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement