关于#python#的问题:并分别为他们的两个属性(name,weapon)赋值,最后分别调用printName, printWeapon方法显示二个对象的属性值

用python编写西游记人物类(XiYouJiRenWu)其中属性有:身高(height),名字(name),武器(weapon),方法有:显示名字(printName),显示武器(printWeapon)

  在主类的main方法中创建二个对象:zhuBaJie,sunWuKong。并分别为他们的两个属性(name,weapon)赋值,最后分别调用printName, printWeapon方法显示二个对象的属性值。
class XiYouJiRenWu:
    def __init__(self,name,height,weapon):
        self.name=name
        self.height=height
        self.weapon=weapon
    def printName(self):
        print(self.name)
    def printWeapon(self):
        print(self.weapon)