Advertisement
Guest User

Swimming record

a guest
Nov 19th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. record_in_seconds = float(input())
  2. distance_in_meters = float(input())
  3. time_per_meter_seconds = float(input())
  4.  
  5. record_to_beat = distance_in_meters * time_per_meter_seconds
  6. slow_down = (distance_in_meters // 15) * 12.5
  7.  
  8. total_time = record_to_beat + slow_down
  9.  
  10. if record_in_seconds > total_time :
  11.     print(f"Yes, he succeeded! The new world record is {abs(total_time):.2f} seconds.")
  12. else:
  13.     time = record_in_seconds - total_time
  14.     print(f"No, he failed! He was {abs(time):.2f} seconds slower.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement