stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Computer Science - McLees - Python Flashcards | StudBud
Explore
/
Computer Science - McLees - Python
Computer Science - McLees - Python
49 terms
·
StudBud Administration
·
5 plays
Imported from external platform
Flashcards
49 cards
F
Practice quiz
P
Host live
L
Questions
49
Answers
1
The resulting output is...
6556
56
5665
65
2
[] is the empty list
List.Extend([__,__])
List.Append(__)
del List[#]
List.Clear(__)
3
Tuples are immutable.
False
True
4
greatest (items must have same type)
Len(List)
List.Remove(__)
Max(List)
Min(List)
5
Choose all principles of lists.
By writing items enclosed in square brackets; items separated by commas.
Cannot be changed in place.
Immutable
6
Python allows out of bounds slicing for indexing for individual items in
slices
lists and tuples
7
concatenation; same as ['a', 1].extend ([2,'b'])
List.Append(__)
List.Remove(__)
+
List.Clear(__)
8
In Python, variable names may begin with...
a letter.
none of the above.
both a letter and an underscore.
an underscore.
9
index of first occurrence of an object
List.Index(__)
List.Count(__)
List.reverse(__)
Len(List)
10
inserts object at end of list
Len(List)
List.append(__)
Min(List)
Max(List)
11
The names given to values stored in memory in Python are called...
statements.
quantities.
literals.
variables.
12
removes first occurrence of an object
del List[#]
List.Clear(__)
List.Remove(__)
List.Append(__)
13
insert new item before item of given index
List.Clear(__)
List.Insert(#,___)
List.Count(__)
del List[#]
14
Why are Tuples different than lists? (Choose all that apply.)
Tuples are mutable, unlike lists.
They can be changed in place, unlike lists.
They are ordered sequences of items, unlike lists.
Tuples cannot be modified in place: They have no append, extend, or insert.
15
Nested Lists & Tuples Exist
True
False
16
Python does
not
allow out of bounds indexing for individual items in lists and tuples.
False
True
17
A combination of numbers, arithmetic operators, and parentheses that can be evaluated is called a numeric...
literals.
operations.
none of the above.
expression.
18
Choose all principles of lists.
Immutable.
Objects can be of any type.
Cannot be changed in place.
19
least (items must have same type)
Max(List)
Min(List)
Len(List)
List.reverse(__)
20
reverses the order of the items
List.Reverse(__)
Max(List)
Sum(List)
List.Index(__)
21
A list is...
mayo an instrument
A list of python string literals that are immutable.
an ordered sequence of Python objects.
always a collection of things I have to buy at the grocery store.
22
An example of a runtime error is...
all of the above.
a misspelled function name.
an undeclared variable.
division by zero.
23
Lists are immutable.
True
False
24
All other list functions and methods apply-Items can be accessed by indices-Can be sliced, concatenated, and repeated.
True
False
25
Choose all principles of tuples.
Objects can be of any type.
Immutable
By writing items enclosed in square brackets; items separated by commas.
Objects do not have to all be the same type.
26
The statement a /= 5 is an example of a(n)...
integer division.
augmented assignment.
logic error.
syntax error.
27
Join method turns single string into list of substrings.
False
True
28
Split method turns single string into list of substrings.
True
False
29
In programming terminology, numbers are called numeric...
literals.
expressions.
none of the above.
operations.
30
A slice is...
a chopping motion.
Cortar
a sublist of a given list.
slicir
31
How are Tuples written?
By writing items enclosed in square brackets; items separated by commas.
Written as comma-separated sequences enclosed in parentheses (preferred).
Using a feathered quill and ink made with black walnuts.
They are written using a combination of dots and dashes.
32
removes item with stated index
del List[#]
List.Insert(#,___)
List.Clear(__)
List.Count(__)
33
A syntax error is caught...
by all of the above.
by the interpreter.
during runtime when an unexpected result is given.
during runtime when the program crashes.
34
total (items must be numbers)
Min(List)
Len(List)
sum(List)
Max(List)
35
Grammatical and punctuation errors are called...
bugs.
syntax errors.
runtime errors.
logic errors.
36
Why are Tuples different than lists? (Choose all that apply.)
Tuples are mutable, unlike lists.
Items of tuple cannot be directly deleted, sorted, or altered.
They are ordered sequences of items, unlike lists.
They can be changed in place, unlike lists.
37
A sequence of consecutive characters from a string is called a(n)...
group.
slice.
run.
cut.
38
number of items in list
Max(List)
List.Remove(__)
Min(List)
Len(List)
39
Choose all principles of lists.
Immutable.
Objects do not have to all be the same type.
Cannot be changed in place.
40
A statement of the form variableName = numericExpression is called a(n)...
expression.
mathematical operation.
assignment statement.
arithmetic statement.
41
Tuples are mutable.
True
False
42
List Repetition | [0]*3 ----> [0, 0, 0]
List.Remove(__)
*
List.Clear(__)
del List[#]
43
In Python, variable names may consist of...
underscores.
digits.
all of the above.
letters.
44
inserts new list's items at end of list
List.Clear(__)
List.Append(__)
List.Extend([__,__])
del List[#]
45
Join method turns a list of strings into a single string.
False
True
46
If right index is too large,
Slice will go to the end of the list.
False
True
47
If left index in slice too far negative
Slice will start at the beginning of the list
False
True
48
number of occurrences of an object
Len(List)
Min(List)
List.reverse(__)
List.Count(__)
49
Lists are mutable.
False
True