Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Tkinter Quiz

Total questions: 20

Worksheet time: 7mins

Name
Class
Date
1.

How do you create a Label widget in Tkinter?

a)

label = Label("Hello")

b)

label = Label(text="Hello")

c)

Label.new("Hello")

d)

 create_Label("Hello")

2.

Which method is used to change the font color in a tkinter widget?

a)

change_color()

b)

config(fontcolor=)

c)

set_fontcolor()

d)

configure(fg="color")

3.

What is the command to create a basic window in tkinter?

a)

create_window()

b)

 window = tk.Tk()

c)

window = BasicWindow()

d)

 window.create()

4.

What does GUI stand for in computer programming?

a)

Graphical User Interaction

b)

General Use Interface

c)

Graphical User Interface

d)

General User Interaction

5.

Which widget is used to input single-line text from the user in Tkinter?

a)

Label

b)

Text

c)

Entry

d)

Frame

6.

What is the function of the pack() method in Tkinter?

a)

Organizing widgets in a grid

b)

Organizing widgets in blocks before placing them in the parent widget

c)

Placing widgets on specific positions in the window

d)

Organizing the layout of multiple windows

7.

Which of the following is a Python library used for creating GUI applications?

a)

Pandas

b)

Matplotlib

c)

Tkinter

d)

NumPy

8.

What is the purpose of creating Frame widgets in a Tkinter application?

a)

To add decorative images

b)

To group related widgets or provide padding

c)

To control the application flow

d)

To set text color schemes

9.

What is the purpose of Tkinter in Python programming?

a)

Handling databases

b)

Creating Graphical User Interfaces (GUIs)

c)

Working with big data

d)

Developing machine learning models

10.

Which widget is used to display text or images that cannot be edited by the user in Tkinter?

a)

Button

b)

Entry

c)

Text

d)

Label

11.

Which parameter in the Button widget defines the text displayed on the button?

a)

text

b)

width

c)

height

d)

Command

12.

What geometry management technique allows specific positioning of widgets in Tkinter?

a)

grid

b)

place() method

c)

pack() method

d)

place() and pack()

13.

Which geometry manager is commonly used in Tkinter for organizing widgets?

a)

Place

b)

Grid

c)

Pack

d)

Layout

14.

What is the purpose of the grid() method?

a)

It creates a new window for the Tkinter application.

b)

Organizes the widgets in a (table-like structure) before placing them in the parent widget.

c)

It sets the font style and size of the label widget.

d)

It displays the window and starts the Tkinter event loop.

15.

What is the purpose of the mainloop() function in Tkinter?

a)

Ends the program execution

b)

Closes the GUI window

c)

Starts the main event loop

d)

Defines the main GUI layout

16.

What is a widget in the context of graphical user interfaces (GUIs)?

a)

A small furry creature that lives on the desktop.

b)

An element or component that users can interact with to perform tasks or access information in a GUI application.

c)

A tool used by developers to debug GUI code.

d)

A virtual container for storing data in a GUI application.

17.

Which widget is commonly used to trigger actions when clicked in Tkinter?

a)

Entry

b)

Label

c)

Button

d)

Frame

18.

Which of the following is NOT a widget in Tkinter?

a)

Button

b)

Label

c)

Frame

d)

Series

19.

What is the purpose of the update_clock() function when creating a digital clock?

a)

It sets the title of the Tkinter window to "Digital Clock".

b)

It retrieves the current time and updates the text of the clock_label widget every second.

c)

It creates a new Label widget named clock_label with a font size of 50.

d)

It initializes the Tkinter event loop and starts the application.

20.

When creating a simple GUI login interface, what should happen if the username is "admin" and the password is "password"?

a)

Display a message indicating invalid credentials

b)

Verify the credentials upon clicking the login button

c)

Exit the program with an error message

d)

Display a success message for incorrect credentials