Commit f629fead by BellCodeEditor

save project

parent 5ec53ebb
Showing with 366 additions and 0 deletions
#类是群体
class Sb:
def __init__(self,name,hp,attack):
self.level = 1
self.hp = 200
self.attack = 20
def upgrade(self):
self.level = self.level+1
self.hp = self.hp+50
self.attack = self.attack+4
houjinitaimei = Sb('后鸡你太美',300,23)
houjinitaimei.upgrade()
print('后鸡你太美的血量为',houjinitaimei.hp)
print('后鸡你太美的等级为',houjinitaimei.level)
print('后鸡你太美的攻击力为',houjinitaimei.attack)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment