题解 | #多部门的打工人#
多部门的打工人
https://www.nowcoder.com/practice/e704f2c5c30c4aa0b1de9e71bc584fb3
class Nowcoder: def __init__(self,name,ID,num) -> None: self.name=name self.ID=ID self.num=num def printInformation(self): print('{}\'s ID is {}, and his or her number of signing in is {}.'.format(self.name,self.ID, self.num)) class IT(Nowcoder): def __init__(self, name, ID, num,langauge) -> None: super().__init__(name, ID, num) self.langauge=langauge class Designer(Nowcoder): def __init__(self, name, ID, num,color) -> None: super().__init__(name, ID, num) self.color=color list01=input().split() list02=input().split() obj_01=IT(list01[0],list01[1],list01[2],list01[3]) obj_02=Designer(list02[0],list02[1],list02[2],list02[3]) obj_01.printInformation() print('{}'.format(obj_01.langauge)) obj_02.printInformation() print('{}'.format(obj_02.color))