Commit 5ecefefd by BellCodeEditor

save project

parent 8f5cddcb
Showing with 10 additions and 4 deletions
...@@ -5,6 +5,12 @@ class Hero: ...@@ -5,6 +5,12 @@ class Hero:
self.h = h self.h = h
self.a = a self.a = a
yase = Hero("垭瑟",300,20) yase = Hero("垭瑟",300,20)
hoyi = Hero("后羿",250,23)
print("垭瑟的血量为:",yase.h) def upgrade():
print("后羿的血量为:",hoyi.h) yase.level = yase.level+1
\ No newline at end of file yase.h = yase.h+50
yase.a = yase.a+4
upgrade()
upgrade()
print(yase.h)
\ 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