2025/2026
Which function returns a list of the named resources (functions and variables) in its argument? -
Answers dir
The expression 2 ** 3 ** 2 evaluates to which of the following values? - Answers 512
The expression round(23.67) evaluates to which of the following values? - Answers 24
What must a programmer use to test a program? - Answers A reasonable set of legitimate
inputs
What must you use to create a multi-line string? - Answers -A single pair of 3 consecutive
double quotation marks
-Embedded newline characters
Which statement imports the functions sqrt and log from the math module? - Answers from
math import sqrt, log
What is used to begin an end-of-line comment? - Answers # symbol
Which of the following lists of operators is ordered by decreasing precedence? - Answers **,*,+
Assume that the variable name has the value 33. What is the value of name after the
assignment name = name * 2 executes? - Answers 66
What does a programmer do during the analysis phase of software development? - Answers
Decides what the program will do and determines its user interface
Consider the following code segment:
x=5
y=4
if x > y:
print( y )
else:
print( x )
What value does this code segment print? - Answers 4
A Boolean expression using the and operator returns True when - Answers both operands are
true