Advertisement
SpasSpasov

pipes in pool

Apr 28th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import math
  2. volume = int(input())
  3. pipe_1 = int(input())
  4. pipe_2 = int(input())
  5. hour = float(input())
  6.  
  7. water = (pipe_1 + pipe_2) * hour
  8.  
  9. if water <= volume:
  10.     print(f"The pool is{water}% full. Pipe 1:{pipe_1}%. Pipe 2: {pipe_2}%".format(math.trunc(water / volume * 0.01), math.trunc(pipe_1  * water / volume * 0.01), math.trunc(pipe_2 * water / volume * 0.01)) )
  11. else:
  12.     print(f"For {hours} hours the pool overflow with {volume} litters")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement