Sichanov

pipes

May 18th, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. volume_pool = int(input())
  2. pipe_1 = int(input())
  3. pipe_2 = int(input())
  4. hours = float(input())
  5.  
  6. volume_pipe_1 = pipe_1 * hours
  7. volume_pipe_2 = pipe_2 * hours
  8. total_litres = volume_pipe_1 + volume_pipe_2
  9.  
  10. if total_litres <= volume_pool:
  11.     procent_total_litre = (total_litres / volume_pool)*100
  12.     procent_volume_pipe1 = (volume_pipe_1 /total_litres)* 100
  13.     procent_total_litre_pipe2 = (volume_pipe_2/total_litres) * 100
  14.  
  15.     print(f"The pool is {procent_total_litre:.2f}% full. Pipe 1: {procent_volume_pipe1:.2f}%. Pipe 2: {procent_total_litre_pipe2:.2f}%.")
  16.  
  17. else:
  18.     overflow = total_litres - volume_pool
  19.     print(f"For {hours:.2f} hours the pool overflows with {overflow:.2f} liters.")
Advertisement
Add Comment
Please, Sign In to add comment