☑ MCQ PRACTICE

Python Programming Unit 4

Practice objective questions for quick revision and examination preparation. Try answering each question before revealing the answer.

📚 Python Programming
📖 Unit 4
🎯 MCQs
Python Programming MCQs - Unit 4

Python Programming MCQs - Unit 4

1

How do you create a window?

A window = newWindow()
B window = Window()
C window = Frame()
D window = Tk()
Correct Answer window = Tk()
2

How do you create an event loop?

A window.loop()
B window.main()
C window.mainloop()
D window.eventloop()
Correct Answer window.mainloop()
3

To create a label under parent window, use _______.

A label = Label(text = "Welcome to Python")
B label = Label(window, text = "Welcome to Python")
C label = Label(text = "Welcome to Python", fg = " red")
D label = Label(text = "Welcome to Python", fg = " red", bg = "white")
Correct Answer label = Label(window, text = "Welcome to Python")
4

To create a button under parent window with command processButton, use _______.

A Button(text = "OK", fg = "red", command = processButton)
B Button(window, text = "OK", fg = "red")
C Button(window, text = "OK", fg = "red")
D Button(window, text = "OK", command = processButton)
Correct Answer Button(window, text = "OK", command = processButton)
5

How do you create a GUI component for displaying multiple-lines of text?

A use Label
B Use Button
C Use Text
D Use Message
Correct Answer Use Message
6

How do you draw a red line from 100, 100 to 400, 500?

A canvas.create_line(100, 100, 100, 500, fill = "red")
B canvas.create_line(100, 100, 400, 100, fill = "Red")
C canvas.create_line(100, 100, 400, 500, fill = "red")
D canvas.create_line(100, 100, 400, 500, filled = "red")
Correct Answer canvas.create_line(100, 100, 400, 500, fill = "red")
7

_______ is not a geometry managers in Tkinter.

A pack
B flow
C grid
D place
Correct Answer flow
8

To place a button in a specified row and column in its parent container, use ________.

A pack manager
B grid manager
C place manager
D flow manager
Correct Answer grid manager
9

Which option do you use to put the components in a container using the pack manager in the same row?

A component.pack(LEFT)
B component.pack(side = LEFT)
C component.pack(side = "LEFT")
D component.pack("LEFT")
Correct Answer component.pack(side = LEFT)
10

The side option of the pack manager may not be _____________.

A LEFT
B RIGHT
C BOTTOM
D MIDDLE
Correct Answer MIDDLE
11

Using a grid manager, you can use the option _________ to place a component in multiple rows and columns.

A row
B column
C rowspan
D colspan
Correct Answer rowspan
12

You cannot display an image in ______________.

A a label
B a button
C a check button
D Entry
Correct Answer Entry
13

To create a menu in a window, use __________

A menubar = Menu(window)
B menubar = MenBar(window)
C menubar = Menu()
D menubar = MenBar()
Correct Answer menubar = Menu(window)
14

You cannot display an image in ______________.

A a label
B a button
C a check button
D Entry
Correct Answer Entry
← Back to All MCQs