+ 3
Why doesnât it stop? Using âorâ
I canât figure this out. The code shown below stops at 0. If you change b to âb=-1â, itâs an infinite loop! I added the break so it would t freeze up my program. So why doesnât the loop keep going when b is 0 also?? Why does it stop? Why wouldnt it stop if b is -1? Help!!!! a=5 b=0 while(a or b): a-=1 if a == -10: break print(a) print(a)
1 Answer
+ 6
-1 is True. The only number that is False is 0