Commit 5f80d817 by BellCodeEditor

save project

parent c4edfe09
Showing with 13 additions and 8 deletions
......@@ -5,12 +5,17 @@ class Hero: #类
self.leve=1
self.attack=attack
def upgrade():
www.leve+=1
www.hp+=50
www.attack+=5
def upgrade(self):
self.leve+=1
self.hp+=50
self.attack+=5
www=Hero("sdeg",300,20)
upgrade()
upgrade()
print(www.hp)
\ No newline at end of file
www.upgrade()
www.upgrade()
print(www.hp)
qqq=Hero("刘艺航",100000,999999)
qqq.upgrade()
qqq.upgrade()
print(qqq.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