- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
bbb = {'name':'Sergey'}
class Race:
aaa = {'type' : 'Bubenchik'}
bbb = False
def __init__(self, type, name):
self.aaa['type'] = type
self.bbb = bbb
def __str__(self):
return "{} - {}, ".format(self.aaa['type'], self.bbb['name'])
if name == "__main__":
orc = Race('orc','Traal')
print(orc)
troll = Race('troll','Vasya')
troll.bbb['name'] = 'Ya skazal VASYA!'
print(troll)
print(orc)
print(bbb)
----------------------------------------
orc - Sergey,
troll - Ya skazal VASYA!,
troll - Ya skazal VASYA!,
{'name': 'Ya skazal VASYA!'}