author:headsen  chen

date: 2018-11-29  17:36:42

 

class p:
    def __init__(self,na,gen,age,fig):
        self.name = na
        self.gender =gen
        self.age =age
        self.fight =fig

    def grassland(self):
        self.fight = self.fight - 200

    def practice(self):
        self.fight =self.fight +200
    def incest(self):
        self.fight =self.fight - 500
    def detail(self):
        temp = "姓名:%s;性别:%s;年龄:%s;战斗力:%s" %(self.name,self.gender,self.age,self.fight)
        print(temp)

cang = p('苍井空','',18,1000)
dong = p('懂你打算','',22,1800)
bo = p('波尔生生','',26,3000)

cang.incest()
dong.practice()
bo.grassland()

cang.detail()
dong.detail()
bo.detail()

 

相关文章:

  • 2022-12-23
  • 2021-10-10
  • 2021-12-06
  • 2021-04-06
  • 2022-02-19
  • 2021-11-20
  • 2021-11-28
猜你喜欢
  • 2021-09-16
  • 2022-12-23
  • 2022-01-10
  • 2022-01-04
  • 2022-02-17
  • 2021-09-23
  • 2022-12-23
相关资源
相似解决方案