wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

tkinter Python 3 GUI

Total questions: 49

Worksheet time: 32mins

Name
Class
Date
1.

Which is the correct way to use tkinter in python

program?

a)

include tkinter *

b)

import tkinter *

c)

from tkinter import *

d)

from tkinter include *

2.

Which of the following function used to create window in

python tkinter.

a)

window()

b)

tk()

c)

toolkit()

d)

wd()

3.

Which of the following function used to create window in

python tkinter.

a)

window()

b)

tk()

c)

toolkit()

d)

wd()

4.

Which of the following attribute used to change the text

color of a Label widget in python tkinter

a)

fg

b)

foreground

c)

bg

d)

background

5.

Which of the following attribute used to change the

background color of a Label widget in python tkinter

a)

background

b)

bg

c)

fg

d)

foreground

6.

Which function is used to set the size of the tkinter

window?

a)

setsize()

b)

size()

c)

geometry()

d)

dimension()

7.

Select the function is used to close the

tkinter window.

a)

destroy()

b)

delete()

c)

stop()

d)

remove()

8.

What is the use of mainloop() function in tkinter window?

a)

To create the window screen

b)

To hold the window screen

c)

To delete the window screen

d)

To disable the window screen

9.

In contrast to a terminal-based program, a GUI-based

program

a)

user needs to wait for the options

b)

completely controls the order in which the user enters inputs

c)

can allow the user to enter inputs in any order

d)

that decided by the window manager pack()

10.

In MVC pattern, the model is responsible for

a)

processing the program's data

b)

managing the program's data

c)

displaying the program's data

d)

control the appearance of data

11.

Is it possible to set the title for a window after creating it?

a)

yes

b)

no

12.

How does the grid() function put the widget on the screen ?

a)

According to x,y coordinate

b)

According to left,right,up,down

c)

According to horizontal,vertical

d)

According to row and column wise

13.

The method(s) to import a tkinter in python program is/are ____________.

a)

import tkinter

b)

import tkinter as t

c)

from tkinter import *

d)

All the above

14.

Screen inside another screen is possible by creating __________

a)

Another window

b)

buttons

c)

labels

d)

frames

15.

The correct way to use the config() function in tkinter is _____________

a)

object.property

b)

config(property)

c)

object.config(property)

d)

config(object,property)

16.

The use of the mainloop() in Python Tkinter is __________

a)

To create a window screen

b)

To Destroy the window screen

c)

To exit window screen

d)

To Hold the window Screen

17.

What is tkinter?

a)

A Python GUI module

b)

A Python Scripting module

18.

It provides a scrollbar to the use so that the use can scroll the window up and down.

a)

Scrollbar()

b)

Spinbox()

c)

Menu()

d)

Entry()

19.

Features of Python

a)

Easy to learn and read

b)

Portable

c)

GUI programming

d)

All of the above

20.

Which command used to change the screen size?

a)

window = Tk()

b)

window.mainloop()

c)

window.geometry("400x300")

21.

Which of the following is easy to use from the user?

a)

Command Line

b)

GUI (Graphical User Interface)

22.

__________ is an element of GUI.

a)

Widget

b)

GUI

c)

Application

23.

Which is the correct way to use tkinter in python

program?

a)

include tkinter *

b)

import tkinter *

c)

from tkinter import *

d)

from tkinter include *

24.

Which of the following function used to create window in

python tkinter.

a)

window()

b)

tk()

c)

toolkit()

d)

wd()

25.

Which of the following attribute used to change the text

color of a Label widget in python tkinter

a)

fg

b)

foreground

c)

bg

d)

background

26.

Which of the following attribute used to change the

background color of a Label widget in python tkinter

a)

background

b)

bg

c)

fg

d)

foreground

27.

______________ library provides fast and easy way to create GUI applications in Python.

a)

Tkinter

b)

IbtikarMaker

c)

Graph

28.

Choose the correct statement to display title.

a)

window.title("My First Program")

b)

window.title(My First Program)

c)

window.title "My First Program"

29.

Label , Button , Sliders are all examples of Widgets.

a)

True

b)

False

30.

Which function is used to set the size of the tkinter

window?

a)

setsize()

b)

size()

c)

geometry()

d)

dimension()

31.

What is the use of mainloop() function in tkinter window?

a)

To create the window screen

b)

To hold the window screen

c)

To delete the window screen

d)

To disable the window screen

32.

It provides a scrollbar to the use so that the use can scroll the window up and down.

a)

Scrollbar()

b)

Spinbox()

c)

Menu()

d)

Entry()

33.

window=Tk() is to create new interface .

a)

true

b)

false

34.

The library that is responsible about creating GUI is

a)

Turtle

b)

TKinter

c)

Maze

35.

window.geometry("300x200") is to change the size of the GUI window into .

a)

500 Height x 200 Width

b)

300 Height x 800 Width

c)

300 Height x 200 Width

36.

It is not possible to set the title of the window after creating it

a)

True

b)

False

37.

Which command used to change the screen size?

a)

window = Tk()

b)

window.mainloop()

c)

window.geometry("400x300")

38.

Which of the following function used to create window in

python tkinter.

a)

window()

b)

tk()

c)

toolkit()

d)

wd()

39.

Which of the following attribute used to change the text

color of a Label widget in python tkinter

a)

fg

b)

foreground

c)

bg

d)

background

40.

Choose the correct statement to display title.

a)

window.title("My First Program")

b)

window.title(My First Program)

c)

window.title "My First Program"

41.

Which function is used to set the size of the tkinter

window?

a)

setsize()

b)

size()

c)

geometry()

d)

dimension()

42.

What is the use of mainloop() function in tkinter window?

a)

To create the window screen

b)

To hold the window screen

c)

To delete the window screen

d)

To disable the window screen

43.

Tkinter is a (a)   module

44.

A new label

a)

x = label(win, text="hi").pack()

b)

in win return Label(text="hi")

45.

To hold the screen what we use ?

a)

mainloop() function

b)

pause() function

c)

Stop() function

d)

None of the above

46.

What is the correct way to use the config() function in tkinter ?

a)

config(object,property)

b)

object.config(property)

c)

config(property)

d)

object.property

47.

What is the right way to set the title of the window ?

a)

title(win,mytitle)

b)

win.title(mytitle)

c)

title(mytitle).win

d)

None of the above

48.

Which of the correct way to set the geometry of the window ?

a)

geometry(x,y)

b)

geometry(300x400)

c)

geometry(300,400)

d)

None of the above

49.

Which of the following function are used to get the data from the Entry field in Python Tkinter ?

a)

get()

b)

Gettext()

c)

Getdata()

d)

All of the above