wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

list,tuples,set

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.
Which data type is used to store multiple items in one variable?
a)
int
b)
list
c)
float
d)
string
2.
Which symbol is used to create a list?
a)
()
b)
{}
c)
[]
d)
<>
3.
Which symbol is used to create a tuple?
a)
[]
b)
{}
c)
()
d)
<>
4.
Which symbol is used to create a set?
a)
[]
b)
()
c)
{}
d)
<>
5.
Are lists changeable?
a)
Yes
b)
No
c)
Sometimes
d)
Never
6.
Are tuples changeable?
a)
Yes
b)
No
c)
Sometimes
d)
Only numbers
7.
Are sets changeable?
a)
Yes
b)
No
c)
Sometimes
d)
Never
8.
Which allows duplicate values?
a)
Set
b)
Tuple
c)
List
d)
None
9.
Which does NOT allow duplicate values?
a)
List
b)
Tuple
c)
Set
d)
All
10.
What is the index of first element in list?
a)
0
b)
1
c)
2
d)
-1
11.
Which method adds item to list?
a)
add()
b)
insert()
c)
append()
d)
put()
12.
Which method adds item to set?
a)
append()
b)
add()
c)
insert()
d)
push()
13.
Which keyword is used to create tuple?
a)
tuple
b)
list
c)
set
d)
data
14.
Which function gives length?
a)
size()
b)
count()
c)
len()
d)
length()
15.
Which method removes item from list?
a)
delete()
b)
remove()
c)
popitem()
d)
cut()
16.
Which method removes item from set?
a)
delete()
b)
remove()
c)
pop()
d)
cut()
17.
What will [1,2,2,3] become in set?
a)
{1,2,3}
b)
{1,2,2,3}
c)
[1,2,3]
d)
Error
18.
Can list store different data types?
a)
Yes
b)
No
c)
Only numbers
d)
Only strings
19.
Can tuple store different data types?
a)
Yes
b)
No
c)
Only numbers
d)
Only strings
20.
Can set store different data types?
a)
Yes
b)
No
c)
Only numbers
d)
Only strings
21.
Which is ordered?
a)
Set
b)
List
c)
None
d)
Dictionary
22.
Which is unordered?
a)
List
b)
Tuple
c)
Set
d)
All
23.
Which supports indexing?
a)
Set
b)
List
c)
None
d)
Both list & tuple
24.
Which does not support indexing?
a)
List
b)
Tuple
c)
Set
d)
All
25.
Which method sorts list?
a)
sort()
b)
order()
c)
arrange()
d)
set()
26.
Can we change tuple item?
a)
Yes
b)
No
c)
Sometimes
d)
Only last item
27.
What is output of len((1,2,3))?
a)
2
b)
3
c)
4
d)
Error
28.
Which keyword creates empty set?
a)
{}
b)
set()
c)
[]
d)
()
29.
Which is faster for membership test?
a)
List
b)
Tuple
c)
Set
d)
All same
30.
Which stores unique items?
a)
List
b)
Tuple
c)
Set
d)
All
31.
Which method joins two sets?
a)
join()
b)
union()
c)
add()
d)
merge()
32.
Which method finds common items in sets?
a)
common()
b)
same()
c)
intersection()
d)
mix()
33.
Which method removes all items from set?
a)
clear()
b)
remove()
c)
delete()
d)
empty()
34.
Which method copies list?
a)
copy()
b)
duplicate()
c)
clone()
d)
paste()
35.
Which method counts item in list?
a)
total()
b)
len()
c)
count()
d)
number()
36.
Which method finds index in list?
a)
find()
b)
search()
c)
index()
d)
locate()
37.
Which allows slicing?
a)
Set
b)
List
c)
None
d)
Dictionary
38.
Which data type is immutable?
a)
List
b)
Set
c)
Tuple
d)
All
39.
Which data type is mutable?
a)
Tuple
b)
String
c)
List
d)
Integer
40.

which keyword is used to create tuple?

a)

tuple

b)

list

c)

set

d)

dict