10/7/2024 11:03AM
Programming Final Exam Questions With
100% Correct Answers
A ____________ is a mutable ordered sequence of Python objects . - answer✔list
In Python, a list may contain objects of any type but they must all be of the same type. -
answer✔False
After the del function or remove method are executed on a list, the items following the
eliminated item are ____________. - answer✔moved one position left in the list
Values used in a Python program that reside in memory are lost when the program terminates. -
answer✔True
Tuples cannot be modified in place. - answer✔True
Which method turns a single string into a list of substrings? - answer✔split
Tuples cannot be sliced. - answer✔False
Lists are mutable. - answer✔True
Which method converts a list of strings into a string value consisting of the elements of the list
concatenated together? - answer✔join
Given the Python statement value = ( 42, "universe", "everything) which statement is illegal in
Python? - answer✔all all illegal
In general, tuples are more efficient than lists. - answer✔True
Objects that cannot be changed in place are called ____________. - answer✔immutable, static,
or unchangable
Which one of the following Python objects can be changed in place? - answer✔list
, ©SIRJOEL EXAM SOLUTIONS
10/7/2024 11:03AM
In the split method, if no separator is specified, the default is ____________. - answer✔any
whitespace character
A Boolean variable can reference one of two values which are - answer✔True or False
A ________ variable is accessible to all the functions in a program file. - answer✔global
A ________ variable is created inside a function. - answer✔local
A flowchart is a tool used by programmers to design programs. - answer✔True
A function definition specifies what a function does and causes the function to execute. -
answer✔False
A local variable can be accessed from anywhere in the program. - answer✔False
A set of statements that belong together as a group and contribute to the function definition is
known as a - answer✔block
A value returning function is - answer✔a function that will return a value back to the part of the
program that called it
A value returning function is like a simple function except that when it finishes it returns a value
back to the part of the program that called it. - answer✔True
A(n) ________ character is a special character that is preceded with a backslash ( \), appearing
inside a string literal. - answer✔escape
A(n) ________ is a name that represents a value stored in the computer's memory. -
answer✔variable
A(n) ________ is a variable that receives an argument that is passed into a function. -
answer✔parameter
A(n) ________ is an object that holds multiple items of data. - answer✔sequence
A(n) ________ is any piece of data that is passed into a function when the function is called. -
answer✔argument
According to the behavior of integer division, when an integer is divided by an integer, the result
will be a float. - answer✔False
Both of the following for clauses would generate the same number of loop iterations. for num in
range(4):