wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python 145

Total questions: 11

Worksheet time: 11mins

Name
Class
Date
1.

Choose the correct statements

a)

Python is a high level programming language

b)

Easy to read

c)

Simple to implement

d)

Hard to implement

e)

It is an open source

2.

Spyder is a

a)

Python editor

b)

Python library

c)

both

3.

Tkinter is

a)

a standard Python library

b)

used to create easy and user friendly User interfaces

c)

both

4.

a='100';

print(type(a));

a)

<class 'int'>

b)

<class 'list'>

c)

<class 'str'>

5.

B = [1, 2, 3, "a", 'bat']

print(type(B))

a)

<class 'int'>

b)

<class 'str'>

c)

<class 'list'>

6.

To import/load the Tkinter library and its pacakges/modules from that library the code is


from tkinter import *


In the above code * denotes

a)

all the modules of tkinter library

b)

any specific module

c)

selected modules

7.

function to name the window is?

a)

heading()

b)

title()

8.

to set dimensions for root window of width 400 and height 300 ?

a)

root.geometry(300,400)

b)

root.dimensions(400,300)

c)

root.geometry(400,300)

d)

root.size(300,400)

9.

root.mainloop()

a)

method on the main window which we execute when we want to run our application

b)

loops forever

c)

waits for events until the user exits the program

10.

button1 = Button(root, text="Hello", command=xyz);

a)

text represents the name on the button

b)

text represents the function to be called onclick of button

c)

command represents the action to be performed on button click

d)

xyz is the name of the function

11.

name = "Purple"

label_name['text'] = name

a)

name is a variable which holds the value purple

b)

label_name is a variable which gets the value of the name variable

c)

label_name is a label which gets updated with the value of name assigned to it