Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #class it is a structure of object
- class GamePerson:
- # атрибуты класса
- name = "PersonName"
- Slogan = "Person SLogan" #string
- conjure = True #or False
- Power = 200
- armor = [25, 37, 40] #список, массив
- Artefacts = {}#множество
- AssosiationDict = dict()
- #методы класса
- def doLive(self):
- print("live method")
- def doDeath(self):
- print("death Meathod")
- def doBattle(self, way, reaction, stamina):
- self.way = way
- self.reaction = reaction
- self.stamina = stamina
- #let's create object of class
- PersonOne = GamePerson()
- PersonTwo = GamePerson()
- print("Тип данного объекта",type(PersonOne))
- PersonOne.doLive()
- print(PersonOne.Slogan)
- PersonOne.Slogan = "I have got the power"
- print(PersonOne.Slogan)
- PersonTwo.doBattle(True, 30,"greate")
- print(PersonTwo.way)
- #print(dir(PersonOne))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement