Commit 04bb9e86 by BellCodeEditor

save project

parent c36b0da2
Showing with 6 additions and 5 deletions
class Hero:
def __init__(self):
def __init__(self,name,hp,attack):
self.level = 1
self.hp = 300
self.attack = 20
self.name = name
self.hp = hp
self.attack = attack
yase = Hero()
print(yase.hp,yase.attack)
yase = Hero('亚瑟',300,20)
print(yase.name,yase.hp,yase.attack)
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