more fore examples

This commit is contained in:
Mert Gör 🇹🇷 2023-05-20 14:49:34 +03:00
parent 1d368de073
commit 15ed46213a
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
3 changed files with 15 additions and 0 deletions

4
for.dict.py Normal file
View File

@ -0,0 +1,4 @@
d = {'ali': 123, 'veli': 765, 'selami': 745, 'ayşe': 271, 'fatma': 754}
for key, value in d.items():
print(key, value)

8
for.tuple.2.py Normal file
View File

@ -0,0 +1,8 @@
a = [('ali', 10), ('veli', 20), ('selami', 30), ('ayşe', 40), ('fatma', 50)]
b = []
for name, no in a:
b.append((no, name))
print(a)
print(b)

3
range.for.py Normal file
View File

@ -0,0 +1,3 @@
for i in range(1, 10):
print(i, end=' ')
print()