Commit 8711e74c by BellCodeEditor

save project

parent e6780ab0
Showing with 8 additions and 13 deletions
...@@ -5,20 +5,15 @@ class Here: ...@@ -5,20 +5,15 @@ class Here:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def upgrade(self):
year.level=year.level+1 self.level=self.level+1
year.hp=year.hp+50 self.hp=self.hp+50
year.attack=year.attack+4 self.attack=self.attack+4
year=Here("亚索",300,20) year=Here("亚索",300,20)
upgrade() year.upgrade()
upgrade() print("亚索的等级为:",year.hp)
huwwi=Here("后羿",240,23) print("亚索的血量为:",year.hp)
print("后羿的血量为:",year.hp)
print("亚索的攻击为:",huwwi.hp)
def upgrade():
year.level=year.level+1
year.hp=year.hp+50
year.attack=year.attack+4
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