Commit 369323d4 by BellCodeEditor

save project

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