Having trouble understanding Boolean expression for factoring out 0.
x,y=24,36
LCM=1
counting=True
while counting:
if (LCM%x and LCM%y) == 0:
print('The LCM is {}'.format(LCM))
break
LCM+=1
LCM evaluates to 24, which is false
But this code gives the correct LCM:
x,y=24,36
LCM=1
counting=True
while counting:
if LCM%x==0 and LCM%y == 0:
print('The LCM is {}'.format(LCM))
break
LCM+=1
LCM is 72, this is correct
Now why can 0 not be factored out? Generally if I type something like 2 and 3 == 0, the expression evaluates to false, but shouldn't syntax work similarly in the example above. So I getting confused.
