I am wondering why this code seems to loop infinitely? The logic, while not False = while True
, and this True is referring to 100 < 0
which is false, hence it should execute the print statement instead, right? Why is it stuck in the loop then..?
num = 100
while not False:
if num < 0:
break
print('num is: ' + str(num))
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…