Python Exception Handling | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python Exception Handling

power = float(input ("Please entre Power in kW: ")) voltage = float (input ("Please entre Voltage: ")) phase = int(input("1 or 3 phase? ")) if phase==1: current = (power/voltage)*1000 print("The current is :" ,round(current, 2)) if phase==3: current = (power/(1.732*voltage))*1000 print("The current is :" ,round(current, 2)) input() Kindly help how to write exception handing. If user input the wrong no something like string.

6th May 2019, 4:28 AM
Kyaw Myo Oo
Kyaw Myo Oo - avatar
1 Answer