wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

list

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.
Which method adds an item to a list?
a)
append()
b)
add()
c)
insert()
d)
push()
e)
extend()
2.
What does list[2] return?
a)
Second item
b)
Third item
c)
Error
d)
First item
e)
Last item
3.
Which operator checks if value exists in list?
a)
in
b)
exists
c)
contains
d)
has
e)
with
4.
How to remove an item by value?
a)
delete()
b)
pop()
c)
remove()
d)
discard()
e)
clear()
5.
What is the index of first element?
a)
0
b)
1
c)
-1
d)
2
e)
None
6.
Which method removes last item?
a)
remove()
b)
pop()
c)
delete()
d)
end()
e)
cut()
7.
What is len([10,20,30])?
a)
2
b)
3
c)
1
d)
0
e)
4
8.
Which creates a list?
a)
(1,2,3)
b)
{1,2,3}
c)
[1,2,3]
d)
<1,2,3>
e)
list{1,2}
9.
Which method sorts a list?
a)
order()
b)
sort()
c)
arrange()
d)
sorted()
e)
set()
10.
Which returns number of occurrences?
a)
size()
b)
len()
c)
count()
d)
index()
e)
find()
11.
What does list.clear() do?
a)
Deletes list
b)
Clears items
c)
Sorts list
d)
Copies list
e)
Adds items
12.
How to access last element?
a)
list[-1]
b)
list[last]
c)
list[end]
d)
list[0]
e)
list[last()]
13.
Which converts string to list of characters?
a)
list(str)
b)
str.list()
c)
convert()
d)
chars()
e)
array()
14.
Which joins lists?
a)
+
b)
-
c)
*
d)
/
e)
%
15.
Which keyword is used in list comprehension?
a)
when
b)
for
c)
during
d)
loop
e)
inlist