Tk.destroy arguments

root = Tk()
#make sure that you define your Tkinter window , even though if you dont by impoerting tkinter if no Tk() window is defined it will automatically create one

root.destroy()
#here Tk.destroy() WILL NOT WORK

Here is what the above code is Doing:
1. It’s creating a Tkinter window called root.
2. It’s destroying the Tkinter window called root.

The reason that you can’t use Tk.destroy() is because it’s not a function of the Tk class. It’s a function of the Tkinter class.

The Tk class is a wrapper around a Tkinter object. The Tkinter class is the one that actually has the destroy() function.

The Tk class is just a way to make it easier to create a Tkinter object.

The Tk class is like a factory that creates Tkinter objects.

The Tkinter class is the one that actually has the destroy() function.