Commit afc6ee04 by BellCodeEditor

save project

parent d0c19678
Showing with 9 additions and 10 deletions
...@@ -4,12 +4,12 @@ class Hero: ...@@ -4,12 +4,12 @@ class Hero:
self.mz=mz self.mz=mz
self.sm=sm self.sm=sm
self.gj=gj self.gj=gj
def one(): def one(self):
yase.dj=yase.dj+1 self.dj=self.dj+1
yase.sm=yase.sm+1 self.sm=self.sm+1
yase.gj=yase.gj+1 self.gj=self.gj+1
yase = Hero("亚瑟",300,20) libai = Hero("李白",240,160)
print("初始血量为:"yase.sm) libai.one()
one() print("等级为:",libai.dj)
one() print(libai.sm)
print("升级后的血量:"yase.sm) print(libai.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