Professional Documents
Culture Documents
while <condition>:
<statement 1>
…
<statement n>
1
3
5
7
9
11
Thank you
Dr. Shereef Abu Al-Maati 4
While loop :
Same example as before but without break & while True
0 . Hi Shereef!
1 . Hi Shereef!
2 . Hi Shereef!
for x in range(3):
print(x,". Hi Shereef!",end=" ")
for x in range(3):
print(x,". Hi Shereef!",end=" , ")
Is really equivalent to
for x in range(0,3):
print(x,". Hi Shereef!")
countdown 10,9,8,..,0
10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 ,
>>>
62126126456623665563
>>>
S
h
e
r
e
e
f
1
3
5
7
9