Basic Data Structures Quiz
Basic Data Structures Quiz
Date:
Section:
A. Tuple
B. List
C. String
D. 2d List
A. Tuple
B. List
C. String
D. 2d List
ages = (12, 5, 8)
B. print (ages[2])
C. ages = ages[2:]
D. ages[0] = 3
A. bnn
B. ba na na
C. banan
D. banana
5. What is the value of num
num after this code runs?
shapes = ["triangle", "square", "hexagon", "circle", "pentagon"]
num = len(shapes)
A. 0
B. 4
C. 5
D. 35
A. Tuple
B. List
C. Dictionary
D. 2d List
A. 0
B. 1
C. 4
D. 6
10. What would the following program print to the screen when run?
my_list = [7, 0, 0, "d", "n", "o", "B"]
my_list.reverse()
A.
B.
d
C.
D.
700donB
print (num)
A. 5, -10, 6
B. -10, -5, 6
C. -5, 10, 6
D. -5, 0, 10, 6
13. Which of the following programs would produce the following output:
1. honey
2. bread
3. jelly
4. plates
my_list.append('yellow')
my_list.extend('yellow')
my_list.replace('yellow')
my_list.add('yellow')
15. What will be the output of the following program?
my_list = [1, 2, 3, 4]
num = 5
print (my_list)
A. [1, 2, 3, 4, 5, 5, 5, 5]
B. [1, 2, 3, 4, 5]
C. [1, 2, 3, 4, 6, 7, 8, 9]
D. [1, 2, 3, 4, 5, 6, 7, 8]