NEW
Font size
WorksheetsCodeHS Python Unit 8 Review
Total questions: 15
Worksheet time: 1hrs 15mins
Which of the following data structures is immutable?
Tuple
List
Dictionary
2D List
What does this program print?
[48, 56, 64, 65, [60, 61, 62]]
[48, 56, 60, 61, 62, 64, 65]
[48, 56, 64, 65, 60, 61, 62]
The program will error.
How many times does this program print "That's a large class!?"
0
1
4
6
What would the following program print to the screen when run?
7
0
0
d
n
o
B
0
0
7
B
o
n
d
B
o
n
d
0
0
7
700donB
Given the following list:
my_list = ["s", "Z", "e", "c", "c", "e", "r", "h", "e", "p", "t"]
which program below would give the following output:
s
e
c
r
e
t
Which values entered into ‘my_list’ would print a value of ‘-1’ after the program has run?
5, -10, 6
-10, -5, 6
-5, 10, 6
-5, 0, 10, 6
Which of the following programs would produce the following output:
1. honey
2. bread
3. jelly
4. plates
Which of the following programs would alter my_list to consist of the following:
[‘red’, ‘green’, ‘blue’, ‘orange’, ‘yellow’]
What will be the output of the following program?
[1, 2, 3, 4, 5, 5, 5, 5]
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 6, 7, 8, 9]
[1, 2, 3, 4, 5, 6, 7, 8]
What kind of data structure is user_data in the following declaration?
user_data = ("TJ", 24, "artLover123")
Tuple
List
String
2d List
What kind of data structure is user_data in the following declaration?
user_data = ["TJ", 24, "artLover123"]
Tuple
List
String
2d List
Which of the following lines of code WILL cause an error? Use the following definition of ages:
ages = (12, 5, 8)
ages = ages + (1, 3, 5)
print(ages[2])
ages = ages[2:]
ages[0] = 3
What does this code snippet print?
fruit = ["b", "n", "n"]
print("a".join(fruit))
bnn
ba na na
banan
banana
What is the value of num after this code runs?
0
4
5
35
What does this program print?
My favorite animal is a dog or penguin
My favorite animal is a penguin or chipmunk
My favorite animal is a dog penguin chipmunk
My favorite animal is a dog or chipmunk
