Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use whilestatement to realize Loop in Python

Shulou Source: shulou.com Published: 2022-06-02 08:03:56 09月27日 Update

This article is to share with you about how to use the whilestatement in Python to achieve a loop. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

I. While statement

What is a cycle?

A loop is simply understood as doing something over and over again.

Format:

While condition judgment:

When the judgment condition (True) is satisfied

Multiple execution statements

The result of conditional judgment: True or False

If True, the code inside the while statement module is executed

If False, then it will not enter the inside of the while statement

Note:

Boolean value with uppercase initials

Because the python language is case sensitive.

II. Cases

Output all numbers between 1 and 100:

Xero1

While x

Tags: Statements loops conditions keys keywords more knowledge articles utility between things code meaning multiple uppercase case letters that is work meeting Boolean Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Linux Shulou Information Shulou Technology OPPO Reno