Commit 369323d4 by BellCodeEditor

save project

parent eb37e0b1
Showing with 9 additions and 5 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,hp,attack):
self.level=1 self.level=1
self.hp=200 self.name=name
self.attack=150 self.hp=hp
xiangyu=Hero() self.attack=attack
print(xiangyu.attack) hero01=Hero('yase',200,30)
print(hero01.name)
hero02=Hero('hoyi',200,30)
print(hero02.name)
\ 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