0
help me to correct this code it's not working
print("welcome to RLC calculator") C == float(input("enter C value")) if C => 1 : XC = C * 314 print ("XC") else: nc = C / 1000000 w = nc * 314 print("XC = " + w)
9 Answers
+ 3
Strange... try this https://code.sololearn.com/cxEZ2e80zW8d/#py
+ 3
Change: C == to C =.
Change: => to >=.
+ 3
C*314 and C * 314 is the same thing. The space is just to make the code easier to read :)
+ 2
Not sure if this is what you want but I hope it helps
print("welcome to RLC calculator")
C = float(input("enter C value"))
if C >= 1:
w = C * 314
print ("XC")
else:
nc = C / 1000000
w = nc * 314
print("XC = " + str(w))
0
C is not defined
0
is it necessary to make space in C*314 C * 314
0
now when the intered number is less than 1 is working but if it more than 1 it doesn't give a result
0
it's work
print("welcome to RLC calculator")
C = float(input("enter C value"))
if C >= 1 :
XC = C * 314
print (str (XC))
else:
nc = C / 1000000
w = nc * 314
print("XC = " + str (w))
the mistakes were =
one c is not Capital letter.
c == instead of C =
=> instead of >=
print("XC") instead of print(str (XC)
print ("XC=" + w) instead of print("XC=" + str (w))
0
C => 1 is 2, 3 or more.