#16 Python Tutorial for Beginners | while loop in Python

Veröffentlicht am: 13 März 2020
auf dem Kanal: Daneyal Lari
286
16

In this video, you will learn while loop.

While loop in Python:
The while statement allows us to repeatedly execute a block of statements as long as a condition is true.

Syntax:
while test_expression:
statements

In the while loop, test expression is checked first. If test_expression evaluates True, then the statements within the body of the loop execute. After one iteration, the test expression is checked again. This process will continues until the test_expression evaluates to False.

While loop with else:
Python supports to have an else statement associated with a loop statement.
If the else statement is used with a while loop, the else statement is executed when the condition becomes false.
The while loop can be terminated with a break statement. In such a case, the else part is ignored. Hence, a while loop's else part runs if no break occurs and the condition is false.

while test_expression:
statement(s)
else:
statement(s)

https://www.prowessapps.in/python

Write your queries at:

daneyallari@gmail.com
prowessapps.in@gmail.com

Please like, comment, share and subscribe.

Thank You

#daneyallari #python #pythonByDaneyalLari


Auf dieser Seite können Sie das Online-Video #16 Python Tutorial for Beginners | while loop in Python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Daneyal Lari 13 März 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 286 Mal angesehen und es wurde von 16 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!