Commit 053f3500 by BellCodeEditor

auto save

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