Advertisement
Spocoman

01. Pipes In Pool

Dec 18th, 2021
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. volume = float(input())
  2. pipe1 = float(input())
  3. pipe2 = float(input())
  4. hour = float(input())
  5. poolV = (pipe1 + pipe2) * hour
  6. poolP = poolV / volume
  7.  
  8. if volume >= poolV:
  9.     print(f'The pool is {poolP * 100:.2f}% full. Pipe 1: {pipe1 / poolV * hour * 100:.2f}%. Pipe 2: {pipe2 / poolV * hour * 100:.2f}%.')
  10.  
  11. else:
  12.     print(f'For {hour} hours the pool overflows with {poolV - volume:.2f} liters.')
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement