Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Person:
- def __init__(self, name, age, sex):
- self.name = name
- self.age = age
- self.sex = sex
- def calculateBornYear(self):
- return 2017-self.age
- michael = Person( "Michael", 18, "Male")
- albin = Person( "Albin", 15, "Male")
- hillary = Person( "Hillary", 69, "Female")
- print michael.age
- print albin.calculateBornYear()
- print hillary.sex
- print michael.sex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement