Commit a59efa2d by BellCodeEditor

save project

parent d09ad4cf
Showing with 11 additions and 10 deletions
......@@ -12,14 +12,15 @@ class Hero:
self.hp=hp
self.attack=attack
def frfgrde():
wukong.level=wukong.level+1
wukong.hp=wukong.hp+50
def frfgrde(self):
self.level=wukong.level+1
self.hp=wukong.hp+50
self.attack=wukong.attack+200
wukong = Hero("悟空",200,40)
wukong = Hero("悟空",200,300)
yase = Hero("亚瑟",300,20)
print(wukong.hp)
frfgrde()
frfgrde()
print("升级两次后",wukong.hp)
print(yase.attack)
\ No newline at end of file
wukong.frfgrde()
print("悟空的初始血量值为:",wukong.hp)
yase.frfgrde()
print("亚瑟的初始血量值为:",yase.hp)
\ 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