This quiz checks what you know about Python GUI libraries. These libraries help you build interactive apps with buttons, windows and more making your programs user-friendly and fun to use!
Question 1
Which GUI toolkit is included with Python and is known for being simple and beginner-friendly?
PyQt
PyQt
Tkinter
PyGTK
Question 2
Which method in Tkinter is used to keep the window running until it's closed by the user?
start()
wait()
mainloop()
show()
Question 3
What will the following code print when the button is clicked?
from tkinter import *
root = Tk()
lbl = Label(root, text = "Hello")
lbl.grid()
def clicked():
lbl.configure(text = "Clicked")
btn = Button(root, text = "Click", command = clicked)
btn.grid()
root.mainloop()
Prints “Hello” forever
Updates the label to “Clicked” when button is clicked
Throws an error
Closes the window
Question 5
What is the correct syntax to add a menu labeled “File” in Tkinter?
root.menu("File")
Menu.add("File")
menu.add_cascade(label='File', menu=item)
menu.add_command('File')
Question 6
Which Tkinter geometry manager places widgets in a grid format like a table?
place()
organize()
grid()
pack()
Question 7
What does the Entry() widget do in Tkinter?
Displays a multiline text area
Adds a menu button
Allows user input in a single-line textbox
Creates a dropdown menu
Question 8
Which of the following GUI libraries is best suited for building cross-platform mobile apps with multi-touch support?
PyQt
Tkinter
Kivy
Streamlit
Question 9
What is the output of this code?
from tkinter import *
root = Tk()
txt = Entry(root)
txt.grid()
txt.insert(0, "Geeks")
print(txt.get())
Nothing, unless user types
Geeks
Error
None
Question 10
What’s the role of the geometry() method in a Tkinter window?
Closes the window
Sets the title
Defines the size of the window
Adds widgets
There are 10 questions to complete.