dkyoseff

Conditional Statements - Exercise / 08. Lunch Break

Jul 12th, 2022 (edited)
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import math
  2.  
  3. serial = str(input())
  4. episode_duration = int(input())
  5. rest_duration = int(input())
  6.  
  7. lunch_time = rest_duration * 0.125
  8. time_to_rest = rest_duration * 0.25
  9.  
  10. time_left = rest_duration - lunch_time - time_to_rest
  11.  
  12. final = time_left
  13.  
  14. if final >= episode_duration:
  15.     print_me = math.ceil(final - episode_duration)
  16.     print(f'You have enough time to watch {serial} and left with {print_me} minutes free time.')
  17.  
  18. elif final <= episode_duration:
  19.     print_me = math.ceil(episode_duration - final)
  20.     print(f"You don't have enough time to watch {serial}, you need {print_me} more minutes.")
  21.  
Advertisement
Add Comment
Please, Sign In to add comment