Commit 6469683d by BellCodeEditor

save project

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