What does the following code do? import tkinter as tk root = tk.Tk() label = tk.Label(root, text="Hello, World!") label.pack() root.mainloop()

CC103 - 3

Quiz
•
Others
•
University
•
Hard
ALVIN CERTEZA
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Displays a label with text inside a window
Opens a text file
Creates a button
Closes a window
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of mainloop() in Tkinter? root.mainloop()
Exits the application
Creates a widget
Starts the GUI event loop
Destroys the root window
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the pack() method do? button.pack()
Destroys a widget
Adds a widget to the grid
Arranges a widget in the window
Changes a widget’s text
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a button that closes the window when clicked? import tkinter as tk root = tk.Tk() button = tk.Button(root, text="Exit", command=root.destroy) button.pack() root.mainloop()
Closes the system
Creates an exit dialog
Closes the window
Minimizes the window
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which geometry manager allows specifying row and column?
pack()
grid()
place()
align()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly adds an entry widget? entry = tk.Entry(root) entry.pack()
Adds a dropdown
Adds a label
Adds a text box for input
Adds a button
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you get the content of an Entry widget? entry.get()
entry.value()
entry.text()
entry.content()
entry.get()
Create a free account and access millions of resources
Similar Resources on Quizizz
43 questions
Geographic Inquiry Quiz

Quiz
•
University
35 questions
Sabtu 21.10.23

Quiz
•
University
40 questions
CC103 - 2

Quiz
•
University
35 questions
Tin 135 -> 167

Quiz
•
University
40 questions
Ict2

Quiz
•
University
43 questions
Ethics 2.0

Quiz
•
University
35 questions
UAS Psikologi Pendidikan

Quiz
•
University
40 questions
Mathematics Quiz

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade