What does “while False” mean?

后端 未结 3 1539
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 17:31

I don\'t undestand how this code works:

i = 1
while False:
    if i % 5 == 0:
        break
    i = i + 2
print(i)

what does while Fa

3条回答
  •  时光说笑
    2020-12-18 18:21

    while True:
    

    means that it will loop forever.

    while False:
    

    means it won't execute.

提交回复
热议问题