Commit a65d0dd9 by BellCodeEditor

save project

parent 607131b1
Showing with 11 additions and 2 deletions
...@@ -4,5 +4,14 @@ class Hero: ...@@ -4,5 +4,14 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.name=name self.name=name
def sj(self):
self.level+=1
self.hp+=8
self.attack+=2
iOS=Hero("苹果公司",300,20) iOS=Hero("苹果公司",300,20)
ACH=Hero("安卓公司",200,15) ACH=Hero("安卓公司",200,15)
\ No newline at end of file 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