i trying to make the if statement wrk
but no chance
can someone help to make this if works pls
Ex:
x = int(raw_input("Please enter an integer: "))
if x < 0:
x == 0
print ‘Negative changed to zero’
elif x == 0:
print ‘Zero’
elif x == 1:
print ‘Single’
else:
print ‘More’
is there a module to import to use this function
it always fine an error on the if line
is it necessary to use to equal sign in the if statement or one is enough?
To set a variable, it’s =, not ==.
You don’t have to use int(raw_input()). You can just use input()
x = input("Please enter an integer: ")
if x < 0:
x = 0
print 'Negative changed to zero'
elif x == 0:
print 'Zero'
elif x == 1:
print 'Single'
else:
print 'More'
but inside the if
it looks that the double == sign is necessary
but what are the rules on this indentation
i put the if inside another sub and i still get this indentation error
if (x==0): 1 ab
firstdimx=activeObject.SizeX*2 2 tab
elif (x>0): 1 tab
firstdimx=seconddimx 2 tab
the code did not transfert as in my file
and i cannot put a pic here in this forum!
if you want i'll open anothere threads in model or basic forum