Commit c64b333a by BellCodeEditor

save project

parent b1ea4a12
Showing with 9 additions and 5 deletions
......@@ -6,11 +6,15 @@ class Human:#Human类
self.attack = attack
#xiaotong = Human()#创建xiaotong这个人物
#print(xiaotong.Hp)#查询血量
def nanl():
xiaotong.attack = xiaotong.attack+5
xiaotong.Hp = xiaotong.Hp+4
def nanl(self):#升级
self.attack = self.attack+5
self.Hp = self.Hp+4
xiaotong = Human("xiaotong",300,1000)
nanl()
nanl()
xiaotong.nanl()#调用
print(xiaotong.attack,xiaotong.Hp)
LAN = Human("LAN",10000,0)
LAN.nanl()#调用
print(LAN.attack,LAN.Hp)
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