Commit 15de3723 by BellCodeEditor

save project

parent e4801df9
Showing with 12 additions and 2 deletions
...@@ -5,6 +5,15 @@ class Herp: ...@@ -5,6 +5,15 @@ class Herp:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
yase = Herp("亚瑟",300,20) yase = Herp("亚瑟",300,20)
print(yase.name) def upgradr():
print(yase.hp) yase.level=yase.level+1
yase.hp=yase.hp+30
yase.attack = yase.attack+50
upgradr()
print(yase.name)
print(yase.hp)
print(yase.attack)
upgradr()
print(yase.name)
print(yase.hp)
print(yase.attack) print(yase.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