Kyle Sponable Kyle Sponable - 1 month ago 6
Python Question

If statement not triggering

I am trying to make this code alternate between setting

i
as 56 and
i
as 0 I cant seem to get the second if statement to trigger. The first one works.

while True:
print 'is55 before if logic is' + str(is56)
if is56 == True:
i = 0
is56 = False
#print 'true statement' + str(i)
print 'True is56 statement boolean is ' + str(is56)
if is56 == False:
i = 56
is56 = True
print 'i is ' + str(i)

Answer

any objections ?

while True:
    print 'is55 before if logic is' + str(is56)
    i = is56 = 0 if is56 else 56             
    print  'i is ' + str(i)