Write a Python program to determine the power output of a machine based on its work done and the time taken.
machine_name
.work_done
(as a float).time_taken
(as a float).power = work_done / time_taken
if-elif-else
structure to classify the machine’s performance based on power:power
is greater than or equal to 1000, print:"Impressive, [machine_name]! Your power output is [power] watts. That's heavy-duty performance!"
power
is greater than or equal to 500 but less than 1000, print:"Good job, [machine_name]! Your power output is [power] watts. You're quite efficient!"
power
is greater than 0 but less than 500, print:"Keep improving, [machine_name]! Your power output is [power] watts. There's room for enhancement."
time_taken
is 0, print:"Error: Time cannot be zero. Please check the input values for [machine_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!