wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python workshop

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

a)
error
b)
d
c)
4
2.

print("hello " * 2)

a)
hellohello
b)
error
c)
hello hello
d)
hello
3.
How can you add a new key-value pair to an existing dictionary d?
a)
d.add(key, value)
b)
d[key] = value
c)
d.append(key, value)
d)
d.insert(key, value)
4.
Select the valid list
a)
list_1 = []
b)
list_2 = [1,2,3,[4,5],6]
c)
list_3 = ["abcd" , {1: "one"}]
d)
all the above
5.

a)
10
b)
55
6.

a)
yes
b)
no
7.

a)
hello
b)
hellokitty
c)
hello\nkitty
d)
kitty
8.

a)
py
b)
Py
c)
y
d)
thon
9.
A dictionary can have a string as key
a)
true
b)
False
10.

a)
['this', 'is', 'a', 'sample', 'text']
b)
[ this is a sample text ]
c)
this
d)
[this] [ is] [a] [sample] [text]