Advertisement
KateWilson

ООП Python. Удаление сотрудника

Aug 23rd, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. class Person:
  2.     def __init__(self, n, s, qualif = 1):
  3.         self.name = n
  4.         self.surname = s
  5.         self.qualification = int(qualif)
  6.     def anketa(self):
  7.         return self.name, self.surname, self.qualification
  8.     def __del__(self):
  9.         print('Bye, mister',self.name,self.surname,', you was and you will be a good boy <3')
  10.  
  11.  
  12. p1 = Person('Kate', 'Tomato', 3)
  13. p2 = Person('Vova', 'Apple', 2)
  14. p3 = Person('Ervin', 'Peach', 1)
  15. print(p1.anketa(), p2.anketa(), p3.anketa())
  16. all_qualifications = []
  17. for one_qualif in p1.qualification, p2.qualification, p3.qualification:
  18.     all_qualifications.append(one_qualif)
  19. for q in p1, p2, p3:
  20.     if q.qualification == min(all_qualifications):
  21.         q.__del__()
  22. input('Нажмите Enter')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement