How to implement infinite loop statement in python: In the while loop statement, you can achieve infinite loop by making the judgment condition never reach False. The code is [while var == 1:print("var = 1 ")].
The operating environment of this tutorial: Windows 7 system, python version 3.9, DELL G3 computer.
How to implement infinite loop statements in python:
Python infinite loop: In the while loop statement, you can achieve an infinite loop by making the judgment condition never reach False. .
Conditional expression:
# var = 1 # while var == 1: # 表达式永远为 True # print("var = 1") # # var = 1 # ... # # var = 1
Boolean value:
# while True: # print("条件为真") # # 条件为真 # ... # # 条件为真
Related free learning recommendations: python video tutorial
The above is the detailed content of How to implement infinite loop statement in python. For more information, please follow other related articles on the PHP Chinese website!