Commit 289de2f3 by BellCodeEditor

auto save

parent 23c09b4a
Showing with 13 additions and 6 deletions
...@@ -5,9 +5,16 @@ class Hero: ...@@ -5,9 +5,16 @@ class Hero:
self.level=15 self.level=15
self.name=name self.name=name
def sj(): def sj(self):
lixin.hp+=20 self.hp+=20
lixin.level+=1 self.level+=1
lixin.gj+=20 self.gj+=20
lixin=Hero("李信",366,89) lixin=Hero("李信",366,89)
print(lixin.hp) lixin.sj()
\ No newline at end of file lixin.sj()
lixin.sj()
lixin.sj()
print("等级为:",lixin.level)
print("生命为:",lixin.hp)
print("攻击力为:",lixin.gj)
\ 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