Commit 05397399 by BellCodeEditor

save project

parent 70850cf8
Showing with 11 additions and 0 deletions
class Human:#Human类
def __init__(self,name,Hp,attack):#self是必须的
self.leavl = 1
self.name = name
self.Hp = Hp
self.attack = attack
#xiaotong = Human()#创建xiaotong这个人物
#print(xiaotong.Hp)#查询血量
xiaotong = Human("xiaotong",300,1000)
print(xiaotong.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