class Attack(object): #创建一个攻击类
def init(self,cross_cut,pick,thorn):
self.cross_cut=cross_cut
self.pick=pick
self.thorn=thorn
def male_warrior(self):
print("%s,横砍" %(self.cross_cut))
def female_warrior(self):
print("%s,竖挑" %(self.pick))
def the_demon(self):
print("%s,直刺" %(self.thorn))
ouyang=Attack(“砍”,“挑”,“刺”)
george=Attack(“砍”,“挑”,“刺”)
lichangchun=Attack(“砍”,“挑”,“刺”)
ouyang.male_warrior()
george.female_warrior()
lichangchun.the_demon()