-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathesercizio2
More file actions
31 lines (23 loc) · 756 Bytes
/
esercizio2
File metadata and controls
31 lines (23 loc) · 756 Bytes
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
class MyDict:
__dizionario = {}
def setDizionario(self, chiave, valore):
MyDict.__dizionario.update({chiave: valore})
def getDizionario(self, chiave):
MyDict.__dizionario[chiave]
class Riempitore(MyDict):
def __init__(self):
pass
def setValoreDizionario(self, chiave, valore):
MyDict.setDizionario(self, chiave, valore)
class Espositore(MyDict):
def __init__(self):
pass
def getVoloreDizionario(self, chiave):
MyDict.getDizionario(self, chiave)
def __main3__():
riempitore = Riempitore()
espositore = Espositore()
for i in range(10):
riempitore.setValoreDizionario("casa", "dolce")
print(espositore.getVoloreDizionario("casa"))
__main3__()