For examples
This commit is contained in:
parent
f23f2bd4ac
commit
2682ad2ce5
4
dict.for.py
Normal file
4
dict.for.py
Normal 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
8
dicts.py
Normal 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
5
for.1.py
Normal 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
4
for.2.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
s = {'Ali', 'Veli', 10, 12.4, 'Selami'}
|
||||
|
||||
for x in s:
|
||||
print(x, '=>', type(x))
|
Loading…
Reference in New Issue
Block a user