while <condition>:
<loop statements>While loops
- Conditional iteration tests a condition to determine if a loop should continue
- Called continuation condition
Examples
x = 10
while x > 0:
print(x)
x = x - 110
9
8
7
6
5
4
3
2
1
count = 0
while (count < 10):
# Point A
print ("Olá...", count)
count = count + 1
# Point B
# Point CConsider the following affirmations and say if they are right or wrong:
count < 10is alwaysTrueat point C.count < 10is alwaysFalseat point B.count < 10is alwaysTrueat point A.count < 10is alwaysFalseat point C.count < 10is alwaysTrueat point B.