Commit 0541030b by BellCodeEditor

save project

parent ceb4f846
Showing with 11 additions and 5 deletions
...@@ -5,7 +5,13 @@ class Hero: ...@@ -5,7 +5,13 @@ class Hero:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
yase = Hero('亚瑟',200,20) yase = Hero('亚瑟',200,20)
print(yase.attack) def upgrade():
print(yase.name) yase.level +=100
print(yase.hp) yase.hp +=100
print(yase.level) yase.attack +=100
\ No newline at end of file upgrade()
upgrade()
print("attack",yase.attack)
print("name",yase.name)
print("hp",yase.hp)
print("level",yase.level)
\ 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