Commit 421220b8 by BellCodeEditor

auto save

parent a65d0dd9
Showing with 4 additions and 7 deletions
...@@ -4,14 +4,12 @@ class Hero: ...@@ -4,14 +4,12 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.name=name self.name=name
def sj(self): def sj(self):
self.level+=1 self.level+=1
self.hp+=8 self.hp+=8
self.attack+=2 self.attack+=2
iOS=Hero("苹果公司",300,20) iOS=Hero("苹果公司",300,20)
ACH=Hero("安卓公司",200,15) ACH=Hero("安卓公司",200,15)
sj(iOS)
print(iOS.hp)
\ 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