try: power = float(input ("Please entre Power in kW: ")) voltage = float (input ("Please entre Voltage: ")) phase = int(input("1 or 3 phase? ")) except: print("Oops! That was no valid number. Try again...") if phase==1: current = (power/voltage)*1000 print("The current is :" ,round(current, 2),"Amp") if phase==3: current = (power/(1.732*voltage))*1000 print("The current is :" ,round(current, 2),"Amp") input()Hi All,
What to retry after exception. How to write the code. Let says the user input wrongly in voltage, just want to go back to voltage after exception. not from start. Also for the phase, I just want to accept 1 or 3, how to code.