Question: Hi, can anyone help me with this python. i tried using the exact same code but it won't work on my idle def 9. [10]

def 9. [10] Find the output printed by this program. Be careful with the output order and the inheritance aspect class Employee: def _init__(self, name='Unyil', code-1): print("Call init in Employee") self.name = name self.code = code def str_(self): return f"Employee {self.name) with code {self.code: 94d}" repr_(self): return f"Employee {self.name}" def printInfo(self): print(self._str_0) class Government Employee (Employee): def __init__(self, name, code, specialty): super() . _init_(name, code) print("call init in Government Employee") self.specialty - specialty def str_(self): return f"GE (self.name) with specialty {self.specialty}" def main(): e - Employee("Gundala",2) #output 1 e.printInfo( #output 2 e . Government Employee("Inul",1, "CS") #output 3 e.printInfo() #output 4 print(isinstance(e, Employee)) #output 5 print(e. _repr_0) #output 6 if name main() main__': Answer: 6. [10] Suppose that the file "ui.txt" contains the text: Don't practice until you get it right, but practice until you can't get it wrong! Find the output printed by this program. #prints #prints with open("ui.txt", "r+") as input: input. seek (7) print(input.read(6)) print(input. tell) for in range(3): input. seek (0) print(input.read(2), end"") p = input. seek(0,2) input.write("abc") input.seek(p) print() print(input.read() #prints #prints
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
