题解 | #多部门的打工人#

多部门的打工人

https://www.nowcoder.com/practice/e704f2c5c30c4aa0b1de9e71bc584fb3

class Nowcoder:
    def __init__(self,*args) -> None:
        self.name = args[0]
        self.id = args[1]
        self.num = args[2]
    def printInformation(self):
        print(f"{self.name}'s ID is {self.id}, and his or her number of signing in is {self.num}.")
        

class IT(Nowcoder):
    def __init__(self,*args):
        super().__init__(*args)
        self.lang = args[3]
    def printInformation(self):
        super().printInformation()
        print(self.lang)

class Designer(Nowcoder):
    def __init__(self,*args):
        super().__init__(*args)
        self.color = args[3]
    def printInformation(self):
        super().printInformation()
        print(self.color)


NiuNiu_input = input().split(' ')
NiuMel_input = input().split(' ')

NiuNiu = IT(*NiuNiu_input)
NiuMel = Designer(*NiuMel_input)

NiuNiu.printInformation()

NiuMel.printInformation()


全部评论

相关推荐

07-24 12:30
湘潭大学 营销
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-22 11:33
点赞 评论 收藏
分享
06-10 23:36
已编辑
首都经济贸易大学 C++
点赞 评论 收藏
分享
07-24 19:01
门头沟学院 Java
后天笔试,又要开始做题了
Sairus:明天10:00笔试
投递京东等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务