Все задачи на 5.10.17 13:00
This commit is contained in:
22
uts/uts_17_aut_py/oop.py
Normal file
22
uts/uts_17_aut_py/oop.py
Normal file
@@ -0,0 +1,22 @@
|
||||
human_list = []
|
||||
|
||||
class Human:
|
||||
def __init__(self):
|
||||
self.__names = []
|
||||
self.say = ''
|
||||
human_list.append(self)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.__names
|
||||
|
||||
@name.setter
|
||||
def name(self, mas):
|
||||
for k in mas:
|
||||
self.__names.append(k.lower())
|
||||
|
||||
|
||||
sam = Human
|
||||
sam.name = 'KEK'
|
||||
sam.say = 'MEME'
|
||||
print(sam.say)
|
||||
Reference in New Issue
Block a user