Commit 7a514f36 by BellCodeEditor

save project

parent 9c3d44a9
Showing with 11 additions and 10 deletions
...@@ -5,20 +5,21 @@ class Hero: ...@@ -5,20 +5,21 @@ class Hero:
self.dps=dps self.dps=dps
self.hp=hp self.hp=hp
h1=Hero('鸭瑟',1,1) h1=Hero('鸭瑟',1,1)
h2=Hero('后裔',2,2)
h3=Hero('小灰灰',200,200)
print('鸭瑟血量:',h1.hp) print('鸭瑟血量:',h1.hp)
h2=Hero('后裔',2,2)
print('后裔血量:',h2.hp) print('后裔血量:',h2.hp)
h3=Hero('小灰灰',200,200)
print('小灰灰血量:',h3.hp) print('小灰灰血量:',h3.hp)
def AddH1Level(): def AddH1Level():
h1.level=h1.level+1 h1.level=h1.level+1
h1.dps=h1.dps*2 h1.dps=h1.dps*2
h1.hp=h1.hp*2 h1.hp=h1.hp*2
AddH1Level() def AddH2Level():
AddH1Level() h2.level=h2.level+1
AddH1Level() h2.dps=h2.dps*2
AddH1Level() h2.hp=h2.hp*2
AddH1Level() def AddH3Level():
AddH1Level() h3.level=h3.level+1
print('鸭瑟血量:',h1.hp) h3.dps=h3.dps*2
\ No newline at end of file h3.hp=h3.hp*2
\ 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