Commit b19b70a4 by BellCodeEditor

save project

parent 29ec9c24
Showing with 9 additions and 13 deletions
...@@ -5,16 +5,12 @@ class Hero: ...@@ -5,16 +5,12 @@ class Hero:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
aqi = Hero("阿七",300,20) def upgrade(self):
killer7 = Hero("柒",250,25)
#print("亚瑟的血量:",yase.hp)
#print("亚瑟的等级:",yase.level)
#print("亚瑟的攻击力:",yase.attack)
def killer():
self.level=self.level+1 self.level=self.level+1
seif.hp=self.hp+10 self.hp=self.hp+10
seif.attack=self.attack+5 self.attack=self.attack+5
aqi.killer() houyi= Hero("阿七",300,20)
print("等级为:",aqi.level) houyi.upgrade()
print("血量为:",aqi.hp) print("等级为:",houyi.level)
print("攻击力为:",aqi.attack) print("血量为:",houyi.hp)
\ No newline at end of file print("攻击力为:",houyi.attack)
\ No newline at end of file
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