class Human: def __init__(self, name, idx,age): self.name = name self.idx = idx self.age = age def humanInfo(self): print(f"Name: {self.name} \n ID: {self.idx} \nAge: {self.age}") class Teacher(Human): def __init__(self, name,idx,age,country=None): self.country = country print("----Teacher Information---") super().__init__(name,idx,age) def teacherFullInfo(self): print(f"Output from Teacher Class\nName:{self.name}, Age: {self.age} ,ID: {self.idx}, Country: {self.country}]") class Student(Human): def __init__(self, name,idx,age,section): self.section = section print("----Student Information---") super().__init__(name,idx,age) def studentFullInfo(self): print(f"Output from Student Class\nName:{self.name}, Age: {self.age} ,ID: {self.idx}, Section: {self.section}") @classmethod def get_user_input(self): while 1: try: name = input('Enter name: ') idx = input('Enter Id: ') age =input('Enter age: ') section =input("Enter section: ") return self(name,idx,age,section) except: print('Invalid input!') continue x = Student.get_user_input() x.humanInfo() x.studentFullInfo() y=Teacher("Abu Kaisar Mohammad Masum", 710002636,"28") y.humanInfo() y.teacherFullInfo()