(Creating Graphics with Tkinter)
Questions and Answers Graded A+
What is the purpose of the Tkinter module in Python?
a) To perform complex mathematical operations
b) To handle file input and output
✔✔c) To create graphical user interfaces (GUIs)
d) To interact with databases
Which function is used to create a Tkinter window?
✔✔a) Tk()
b) create()
c) window()
d) mainloop()
How do you add a widget like a button to a Tkinter window?
a) window.add(button)
✔✔b) button.pack()
1
, c) window.insert(button)
d) window.button()
What is the purpose of the `mainloop()` method in Tkinter?
a) To close the window after execution
✔✔b) To run the Tkinter event loop, allowing interaction with the window
c) To load external files into the window
d) To initialize the window
Which of the following is used to create a label widget in Tkinter?
a) Label.create()
b) Label.create_text()
✔✔c) Label()
d) Text()
How can you change the text of a Tkinter label?
✔✔a) label.config(text="New Text")
b) label.set("New Text")
2