Commit b7093e5d by BellCodeEditor

save project

parent 3a20df82
Showing with 16 additions and 6 deletions
class Hero:
def __init__(self):
def __init__(self,a,b,c):
self.level=1
self.hp=300
self.attack=20
yase=Hero()
self.hp=b
self.attack=c
self.name=a
yase=Hero("亚瑟",400,200)
houyi=Hero("后意",2000,50)
print(yase.hp)
\ No newline at end of file
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
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