-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex39-StudyDrills.py
69 lines (50 loc) · 1.75 KB
/
ex39-StudyDrills.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Parezga = {'Sulaymaniyah' :'SUL' , 'Hewler': 'EBL', 'Duhok': "DH", 'Hallebce': 'HB', 'Kerkuk': 'KR'}
Shar = {'SUL': 'Chemchemall', "EBL": 'koye', "DH": 'Zaxo'}
# Chend Shareky trysh zyad dekeyn
Shar["HB"] = 'Xwrmall'
Shar["KR"] = 'Twzz'
# Sharek print ekeyn bo parezga
print('=' * 10)
print(" Parezgay SUL Em sharey tedaye:", Shar['SUL'])
# Chend parezgayak print dekeyn legell kwrtkrawekey
print('=' * 10)
print('kwrtkrawey Sulaymaniyah brytye le: ', Parezga['Sulaymaniyah'])
# Be bekarhenany shar w parezga
print('=' * 10)
print("Parezgay Kerkuk em sharey tedaye:", Shar[Parezga['Kerkuk']])
# Kwrtkrawey hemw Sharekan
print('=' * 10)
for parezga, kwrtkrawe in Parezga.items():
print("Kwrtkrawey Prezgay {} brytye le {}".format(parezga, kwrtkrawe))
# Sharekan bke naw pasregakanewe
print('=' * 10)
for kwrtkrawe, shar in list(Shar.items()):
print("{} Shary {}i Tedaye".format(kwrtkrawe, shar))
#Hemwy be yekwe dabney
for parezga, kwrtkrawe in list(Parezga.items()):
print("Parezgay {} Kwrtrawekey brytye le {}, Herweha Em sharey tedaye: {}".format(parezga, kwrtkrawe, Shar[kwrtkrawe]))
# Detwany kwrtkrawe be destb heny ke bwny nye le listeke
parezga = Parezga.get("Bexdad")
if not parezga:
print("Bbwre Teyda nye")
# Lebergrtnewey Sharekan bo DICT
SharyTr = Shar.copy()
print(Shar)
# Gorrryny nawy Shar
Shar['KR'] = 'Dibs'
print(Shar)
# Bzane ew share le dict heye?
if "SUL" in Shar:
print("Belle Teydaye")
else:
print("Nexer bwny nye")
# Herweha Detwany item bssrytewe le kota dane
#Shar.popitem()
#print(Shar)
# Herweha Detwany dyarybkeyt kame bsrretewe
#del Shar["EBL"]
#print(Shar)
# Detwany Dict sfrbkeytewe(pakbkyetewe) be .clear .
# Detwany le Chend dict ek le yek bdey
SharParezga = {'Shar': Shar, 'Parezga': Parezga}
print(SharParezga)