Commit 4ba6130b by BellCodeEditor

save project

parent d6c81a0f
Showing with 21 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
sb1=Hero('sb1',500,10000)
sb2=Hero('sb2',550,15000)
sb3=Hero('sb2',600,20000)
print(sb1.attack)
print(sb2.attack)
print(sb3.attack)
def upgrade():
sb1.level+=1
sb1.hp+=500
sb1.attack+=5000
upgrade()
print(sb1.level)
print(sb1.hp)
print(sb1.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