Commit 0ee5baf7 by BellCodeEditor

save project

parent 3b8397da
Showing with 12 additions and 3 deletions
class Hero:
def __init__(self,hp,name,attack):
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
yuange=Hero('yuange',5999,50)
lixin=Hero('lixin',9503,37)
yuange=Hero('yuange',5799,190)
lixin=Hero('lixin',9303,137)
print(yuange.attack)
print(lixin.attack)
def upgrade():
lixin.level+=1
lixin.hp+=100
lixin.attack+=30
upgrade()
upgrade()
print(lixin.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