For examples

This commit is contained in:
Mert Gör 🇹🇷 2023-05-20 14:23:13 +03:00
parent f23f2bd4ac
commit 2682ad2ce5
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
6 changed files with 27 additions and 0 deletions

4
dict.for.py Normal file
View File

@ -0,0 +1,4 @@
d = {'Ali': 123, 'Veli': 478, 'Selami': 75, 'Ayşe': 642, 'Fatma': 39}
for key in d:
print(key, '=>', d[key])

8
dicts.py Normal file
View File

@ -0,0 +1,8 @@
d = {'Ali': 123, 'Veli': 478, 'Selami': 75, 'Ayşe':642, 'Fatma': 39}
k = dict()
for key in d:
k[d[key]] = key
print(d)
print(k)

5
for.1.py Normal file
View File

@ -0,0 +1,5 @@
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for i in a:
print(i, end=' ')

4
for.2.py Normal file
View File

@ -0,0 +1,4 @@
s = {'Ali', 'Veli', 10, 12.4, 'Selami'}
for x in s:
print(x, '=>', type(x))

3
s.for.py Normal file
View File

@ -0,0 +1,3 @@
s = 'ankara'
for c in s: print(c)

3
unwrap.py Normal file
View File

@ -0,0 +1,3 @@
l = [('ali', 123), ('veli', 65), ('selami', 340), ('ayşe', 71)]
for name, no in l:
print(name, no)