more while examples
This commit is contained in:
parent
9894e496c2
commit
a1dadd8d93
5
s.ankara.py
Normal file
5
s.ankara.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
s = 'ankara'
|
||||
|
||||
while s:
|
||||
print(s)
|
||||
s = s[1:]
|
6
s.while.py
Normal file
6
s.while.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
s = {1, 10, 'ali', 20, 'veli', 'selami'}
|
||||
|
||||
while s:
|
||||
x = s.pop()
|
||||
print(x, end = ' ')
|
||||
|
7
while-5.2.py
Normal file
7
while-5.2.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
i = 10
|
||||
|
||||
while i > 0:
|
||||
print(i, end=" ")
|
||||
i -= 1
|
||||
else:
|
||||
print('Çıkış değeri:', i)
|
7
while-5.py
Normal file
7
while-5.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
i = 10
|
||||
|
||||
while i:
|
||||
print(i, end=' ')
|
||||
i -= 1
|
||||
else:
|
||||
print('Çıkış değeri', i)
|
Loading…
Reference in New Issue
Block a user