Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Person:
- def __init__(self, n, s, qualif = 1):
- self.name = n
- self.surname = s
- self.qualification = int(qualif)
- def anketa(self):
- return self.name, self.surname, self.qualification
- def __del__(self):
- print('Bye, mister',self.name,self.surname,', you was and you will be a good boy <3')
- p1 = Person('Kate', 'Tomato', 3)
- p2 = Person('Vova', 'Apple', 2)
- p3 = Person('Ervin', 'Peach', 1)
- print(p1.anketa(), p2.anketa(), p3.anketa())
- all_qualifications = []
- for one_qualif in p1.qualification, p2.qualification, p3.qualification:
- all_qualifications.append(one_qualif)
- for q in p1, p2, p3:
- if q.qualification == min(all_qualifications):
- q.__del__()
- input('Нажмите Enter')
Advertisement
Add Comment
Please, Sign In to add comment