Commit f90b87c3 by BellCodeEditor

save project

parent b7093e5d
Showing with 9 additions and 12 deletions
......@@ -4,15 +4,12 @@ class Hero:
self.hp=b
self.attack=c
self.name=a
yase=Hero("亚瑟",400,200)
houyi=Hero("后意",2000,50)
def upgrade(self):
self.level+=1
self.hp+=50
self.attack+=20
yase=Hero("亚瑟",400,20)
yase.upgrade()
yase.upgrade()
def upgrade():
yase.level+=1
yase.hp+=50
yase.attack+=20
upgrade()
print(yase.hp)
print(houyi.attack)
print(yase.attack)
\ No newline at end of file
print(yase.level)
\ 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