I am trying to implment inheritance into my school work but it is not working. This the code which I have written, this is a basic version of it:
from tkinter import *
class First(Frame):
def __init__(self,master):
super(First,self).__init__(master)
self._x = int(input("Int: "))
class Second(Frame):
def __init__(self,master):
super(Second,self).__init__(master)
self._y = self._x + 9
class Third(First,Second):
def __init__(self,master):
super(Third,self).__init__(master)
print(self._y)
root = Tk()
root.configure(background='light grey')
myGUI = First(root)
Third()
root.mainloop()
Im trying to make it make the user input a int then +9 then print it using inheritance. But i keep getting the error:
TypeError: __init__() missing 1 required positional argument: 'master'
My code may look very messy but im new to python so apologies, thanks for help.
Third:Third()