a1 = int(0)
a2 = int(0)
b1 = int(0)
b2 = int(0)
while a1 and a2 != 10 or b1 and b2 != 10:
something
Basically the code won't run something, I'm not too sure what's wrong with my While conditions, any ideas?
a1 = int(0)
a2 = int(0)
b1 = int(0)
b2 = int(0)
while a1 and a2 != 10 or b1 and b2 != 10:
something
Basically the code won't run something, I'm not too sure what's wrong with my While conditions, any ideas?
while a1 and a2 != 10
does not check if both a1 and a2 are 10. It is two conditions, a1
and a2 != 10
. And a1
evaluates to False
since it is 0.
Also, you don't need to say int(0)
; just 0
is fine.