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)

4th Jun 2017, 6:14 PM
HASSAN AIT BIHI
9 Answers
4th Jun 2017, 6:34 PM
Pedro Cruz
Pedro Cruz - avatar
+ 3
Change: C == to C =. Change: => to >=.
4th Jun 2017, 6:18 PM
Rrestoring faith
Rrestoring faith - avatar
+ 3
C*314 and C * 314 is the same thing. The space is just to make the code easier to read :)
4th Jun 2017, 6:29 PM
Pedro Cruz
Pedro Cruz - avatar
+ 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))
4th Jun 2017, 6:23 PM
Pedro Cruz
Pedro Cruz - avatar
0
C is not defined
4th Jun 2017, 6:21 PM
HASSAN AIT BIHI
0
is it necessary to make space in C*314 C * 314
4th Jun 2017, 6:26 PM
HASSAN AIT BIHI
0
now when the intered number is less than 1 is working but if it more than 1 it doesn't give a result
4th Jun 2017, 6:29 PM
HASSAN AIT BIHI
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))
4th Jun 2017, 6:38 PM
HASSAN AIT BIHI
0
C => 1 is 2, 3 or more.
26th Jun 2017, 6:14 AM
Wynn Liaw
Wynn Liaw - avatar