Advertisement
fkudinov

14. Every Person is Unique / Вирішуємо задачі на Python CheckIO Українською

Dec 7th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | Source Code | 0 0
  1. class Person:
  2.     def __init__(self, first_name, last_name, birth_date, job, working_years, salary, country, city, gender='unknown'):
  3.         raise NotImplementedError
  4.  
  5.  
  6. if __name__ == '__main__':
  7.     #These "asserts" using only for self-checking and not necessary for auto-testing
  8.  
  9.     p1 = Person("John", "Smith", "19.09.1979", "welder", 15, 3600, "Canada", "Vancouver", "male")
  10.     p2 = Person("Hanna Rose", "May", "05.12.1995", "designer", 2.2, 2150, "Austria", "Vienna")
  11.     assert p1.name() == "John Smith", "Name"
  12.     assert p1.age() == 38, "Age"
  13.     assert p2.work() == "Is a designer", "Job"
  14.     assert p1.money() == "648 000", "Money"
  15.     assert p2.home() == "Lives in Vienna, Austria", "Home"
  16.     print("Coding complete? Let's try tests!")
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement