Commit 6469683d by BellCodeEditor

save project

parent 3b804104
Showing with 16 additions and 7 deletions
class Hero: class Hero:
def __init__ (self): def __init__ (self,name,hp,attack):
self.level=2 self.level=2
self.hp=500 self.name=name
self.attack=50 self.hp=hp
yase=Hero() self.attack=attack
print(yase.level)
def uprgrade():
yase.level+=50
yase.hp+=50
yase.attack+=50
yase=Hero("亚瑟",300,50)
#houyi=Hero("后羿",300,50)
print(yase.hp) print(yase.hp)
print(yase.attack) #print(houyi.attack)
\ No newline at end of file uprgrade()
print(yase.hp)
\ 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