Commit 053f3500 by BellCodeEditor

auto save

parent 4434268b
Showing with 9 additions and 6 deletions
class Hero: class Hero:
def __init__(self): def __init__(self,name,leave,hp):
self.leave=1 self.name=name
self.hp=200 self.leave=leave
self.hp=hp
self.attact=150 self.attact=150
yase=Hero() #实例化对象 yase=Hero('亚瑟',1,200)
print(yase.hp) houyi=Hero('后羿',2,300)
\ No newline at end of file print(yase.hp)
print(houyi.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