I want the user to input values only to the needed variables (Eg: If you need to get the power ignore the input power and only input to the remaining variables). I would really appreciate the help.
Code:
Power = int(input("Power: "))
Current = int(input("Cuurent: "))
Voltage = int(input("Voltage: "))
def P(C,V):
return C * V
def C(P,V):
return P / V
def V(P,C):
return P / C
if Power == None:
print(P(Current,Voltage))
elif Current == None:
print(C(Power,Voltage))
else:
print(V(Power,Current))
Error:
Traceback (most recent call last):
File "C:\Users\tharu\Desktop\Python.py", line 1, in <module>
Power = int(input("Power: "))
ValueError: invalid literal for int() with base 10: ''