Computer Science, asked by chouhantanvi144, 5 months ago

yuun. (71
loop body. ( )
(F)
ks)
The while loop has three main components Initialization,
4. There are three membership operators in Pyt​

Answers

Answered by SabrinaHaque
1

In Python, While Loops is used to execute a block of statements repeatedly until a given condition is satisfied. And when the condition becomes false, the line immediately after the loop in the program is executed. While loop falls under the category of indefinite iteration. Indefinite iteration means that the number of times the loop is executed isn’t specified explicitly in advance.

Example:

# Python program to illustrate

# while loop

count = 0

while (count < 3):

count = count + 1

print("Hello Sabrina")

print()

# checks if list still

# contains any element

a = [1, 2, 3, 4]

while a:

print(a.pop())

Similar questions