Advertisement
Sim0o0na

Pool Pipes

May 8th, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. poolV = int(input())
  2. P1 = int(input())
  3. P2 = int(input())
  4. time = float(input())
  5.  
  6. p1Full = time * P1
  7. p2Full = time * P2
  8.  
  9. waterInThePool = p1Full + p2Full
  10.  
  11. if waterInThePool <= poolV:
  12.     waterProcFull = (int)((waterInThePool / poolV) * 100)
  13.     pipe1Proc = (int)((p1Full / waterInThePool) * 100)
  14.     pipe2Proc = (int)((p2Full / waterInThePool) * 100)
  15.     print(f"The pool is {waterProcFull}% full. Pipe 1: {pipe1Proc}%. Pipe 2: {pipe2Proc}%.")
  16. else:
  17.     print("For %.1f hours the pool overflows with %.1f liters." % (time, waterInThePool - poolV))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement