python中的while的循环语句

47 阅读1分钟

while 语句一般用于实现条件循环,该语句由关键字while,循环语句和英文冒号组成,while语句和从属于该语句的代码段组成循环结构。语法格式如下:

while 循环条件:

代码段

以下是while语句代码和代码的运行

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png