class Contact:
def __init__(self, name, last_name, number):
self.name, self.last_name, self.number = name, last_name, number
class ContactList:
def __init__(self):
self.contact_list = {}
def adding(self, *who):
self.contact_list = self.contact_list.fromkeys(range(1, len(who)+1), ['example'])
self.checker = []
for z in range(len(who)):
self.checker.append([ who[z].name, who[z].last_name, who[z].number ])
for i in range(1,len(self.checker)+1):
if not self.checker[0][-1] in list(self.contact_list.values()):
self.contact_list.update( { i : self.checker[0] } )
self.checker.pop(0)
print(self.contact_list)
# print( 'Добавление: Контакт добавлен')
return self
def show_list(self):
return self.contact_list