stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Final Review #1 Flashcards | StudBud
Explore
/
Final Review #1
Final Review #1
16 terms
·
StudBud Administration
·
11 plays
Imported from external platform
Flashcards
16 cards
F
Practice quiz
P
Host live
L
Questions
16
Answers
1
Assume that script.py and data.csv are in the same directory. What will the expression
lines_in_file[1]
reduce to?
"5, 6, 7, 8\n"
['5', '6', '7', '8']
"5, 6, 7, 8"
[5, 6, 7, 8]
2
What will be the value of
fruits
after fruits.remove("lettuce") is called?
An empty set
{"apple", "orange", "banana", "tomato", "lettuce"}
{"apple", "orange", "banana", "tomato"}
Error
3
What value does this expression reduce to:
not (5 > 6 or 5 > 2)
True
False
4
What is the value of
colors[2][-1]
?
'w'
'l'
'u'
'e'
5
What value does this expression reduce to:
student_grades["Bob"]
?
92
78
95
85
6
Which best describes a dictionary in Python?
An iterable data structure that allows duplicate elements.
An unordered collection of key-value pairs.
A data structure that is primarily used for mathematical operations.
An ordered collection of unique elements.
7
What will be the output of the following code?
{1, 2, 3, 4, 5}
{}
{3}
{1, 2, 3}
8
Which best describes an object in Python?
A collection of related data and methods that operate on the data.
A data type that stores a sequence of characters.
A reserved word used to define the data type of a variable.
A structure that holds multiple values of the same data type.
9
Assume script.py and data.csv are in the same directory. What will the expression
lines_in_file[2][2]
reduce to?
11
Error
"11"
"9, 10, 11, 12\n"
10
What will be the output of the following code?
40
64
26
13
11
Consider the function below. What is the value of
mystery(0, 8)
?
9
16
25
0
12
Consider the function below. What will be the value of
mystery(6, 3)
?
5
54
9
4
13
What value does this expression reduce to:
999990 % 2 + 1
2
None
1
999991
14
What value does this expression reduce to:
"Hello, World!"[7:12]
?
"World"
"World!"
"Wo"
"o, Wo"
15
What value does this expression reduce to:
numbers[1:6:2]
?
[9, 25, 49]
[4, 16, 36]
[4, 25]
[1, 9, 25]
16
Which best describes a set in Python?
A sequence of elements that is mutable and indexed.
An ordered collection of key-value pairs.
A one-dimensional array that can hold any data type.
An unordered collection of unique elements.