Commit f173e694 by BellCodeEditor

save project

parent d6c81a0f
Showing with 19 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
roy=Hero('roy',300,1000)
liz=Hero('liz',1000,500)
taole=Hero('taole',100,1000)
print(roy.attack)
print(liz.attack)
print(taole.attack)
def upgrade():
roy.level+=1
roy.hp+=50
roy.attack+=4
upgrade()
print(roy.level,roy.hp,roy.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