Commit f59d5cd1 by BellCodeEditor

auto save

parent f01e577b
Showing with 8 additions and 4 deletions
...@@ -4,7 +4,11 @@ class Person: ...@@ -4,7 +4,11 @@ class Person:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade(self):
yase.level += 1
yase.hp += 20
yase.attack += 4
yase = Person(1, 99, 20) yase = Person(1, 99, 20)
houyi = Person(2, 100, 70) yase.upgrade()
print(yase.level) print(yase.hp)
print(houyi.level) \ No newline at end of file
\ 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