Write a Python program to determine if a water pump system is operating within safe limits based on pressure, flow rate, and pipe diameter.
Ask the user for the pump system’s name and store it in a variable called pump_name
.
Ask for the pressure of the system (in Pascals) and store it in a variable called pressure
(as a float).
Ask for the flow rate of the system (in cubic meters per second) and store it in a variable called flow_rate
(as a float).
Ask for the pipe diameter (in meters) and store it in a variable called diameter
(as a float).
Calculate the velocity of the water using the formula:
velocity= (4 * flow_rate) / (π * diameter**2)
Use an if-elif-else
structure to classify the pump system’s performance based on velocity:
"Warning, [pump_name]! Water velocity is [velocity] m/s, which exceeds safe limits!"
"Caution, [pump_name]! Water velocity is [velocity] m/s. Monitor the system closely!"
"Safe, [pump_name]! Water velocity is [velocity] m/s. The system is operating within limits."
"Error: Pipe diameter cannot be zero. Please check the input values for [pump_name]."
We’re always looking for international STEM educators to join our team. If you are interested, please send us a mail and we’ll get back to you!
If you have any questions, kindly send us a mail. Don’t forget to follow and like all our social accounts to get updates on competitions!