What is the result of evaluating 7%2 ? correct answers 1
What is the output from the following program, assuming that the user enters the input value 5.
def main():
n = eval(input("Enter a number: "))
ans=0 for x in range(1,n):
ans = ans + x
print(ans) correct answers none of the above
5: 10
Identifiers in Python may not contain correct answers spaces
Suppose a program executes the following statement.
value = eval(input("Enter a number: "))
In response to the prompt, the user types 5 + 5. What is the result? correct answers value contains
10
The fragment of code eval(input("Enter a number: ")) is best described as: correct answers an
expression that returns the result of evaluating what the user types
What Python statement allows the math library to be used in a program? correct answers import
math
What is the result of evaluating list(range(1,7,2)) ? correct answers none of the above
[1,3,5]
What is the result of evaluating 3 + 4.0 correct answers 7.0
Fragments of code that produce new data values are called correct answers expressions
The goal of the specification phase of the software development process is correct answers to
determine what the program should do
Suppose that the variable x has the value 5 and y has the value 10. After executing this
statement:
x,y = y,x
what will the values of x and y be, respectively? correct answers 10 and 5
When a Python int gets "too large" it correct answers requires more memory to store
What is the output from the following code fragment:
fact=1
for factor in range(5):
fact = fact * factor
, print(fact) correct answers 0
Which of the following is a correct Python expression for converting temperatures from Celsius
to Fahrenheit? correct answers fahrenheit = (9/5) * celsius + 32
Suppose that the variable x has the value 5 and y has the value 10. After executing these
statements: correct answers 10 and 10
Which of the following is a counted loop that executes 5 times? correct answers for i in range(5):
Which of the following is not an example of a function from the Python math library? correct
answers abs(x)
What is the result of evaluating 7//2 ? correct answers 3
The goal of the design phase of the software development process is correct answers to create an
algorithm that solves the problem
Suppose that the variable x currently has the value 20. What statement would cause the value of
x to become 25? correct answers x = x+5
The program pattern IPO stands for correct answers input process output
Consider the following program:def main():
num = eval(input("Enter a number: "))
for i in range(5):
num = num // 2
print(num)
main() if you entered in 1024 correct answers 32
What is the output from the following program fragment?
for i in [1,3,5,7]:
print(2 * i, end=" ") correct answers 2 6 10 14
What is the result of evaluating the expression list(range(5)) ? correct answers [0, 1, 2, 3, 4]
The Python reserved word for performing output to the screen is correct answers print
Magnetic or optical media are generally used for: correct answers secondary memory
The Python numeric type that can represent positive and negative whole numbers is correct
answers int
Python identifiers must start with a letter or underscore. correct answers