Commit 5d34d2d9 by BellCodeEditor

save project

parent d6c81a0f
Showing with 18 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.hp=hp
self.name=name
self.attack = attack
def uplevel():
sb.level=sb.level+1
sb.hp = sb.hp + 10000
sb.attack=sb.attack+200
sb = Hero("sb",10000,100)
print(sb.name+"1:"+str(sb.attack))
uplevel()
uplevel()
uplevel()
print(sb.name+"n:"+str(sb.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