import tkinter as tk root = tk.Tk() # Creates a new window root.title("Hello World") # Sets the title of the window label = tk.Label(master=root, text="Hello World!") # Creates a label widget label.pack() # Packs the label widget into the window root.mainloop() # Starts the event loopHere, we have imported the Tkinter library into our Python code and created a new window by calling the `Tk()` method. We then set the title of the window using the `title()` method. Next, we created a label widget using the `Label()` method and passed it the arguments `master` (the window object) and `text` ("Hello World!"). We then packed the label widget into the window using the `pack()` method. Finally, we started the event loop by calling the `mainloop()` method, which handles user events and keeps the window open until it is closed. Package library: The package library used in this example is `tkinter`.