Commit 0e129619 by BellCodeEditor

save project

parent c662d8c6
Showing with 4 additions and 4 deletions
...@@ -5,10 +5,10 @@ class hero: ...@@ -5,10 +5,10 @@ class hero:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade(): def upgrade(self):
chenshi.level = chenshi.level+1 self.level = chenshi.level + 1
chenshi.hp = chenshi.hp +50 self.hp = chenshi.hp +50
chenshi.attack + 4 self.attack + 4
chenshi = hero("陈石"300,20) chenshi = hero("陈石"300,20)
print(chenshi.name+"一级攻击力是"+str(chenshi.attack)) print(chenshi.name+"一级攻击力是"+str(chenshi.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