CNIT 155 PRACTICE EXAM QUESTIONS & ANSWES
The input function returns a Boolean if the user types in T or false - Answers -False
While loops are pretest loops T or F - Answers -True
sum_total is a legal Python identifier T or F - Answers -True
If you enter a bunch of letters in response to the input function, the input function returns
a string. T or F - Answers -True
Computers can create true random numbers T or F - Answers -False
String can be used as a sequence in a for loop T or F - Answers -True
in is a reserved word in Python T or F - Answers -True
In python, the division operator (/) gives a float result, even if both of the numbers are
integers T or F - Answers -True
if is a legal Python identifier T or F - Answers -False
The int function can be used to convert a string of digits into an integer T or F -
Answers -True
Which character starts a comment in a Python program?
$
#
%
& - Answers -#
What is the output of the following code?
n = 20
while (n <= 25):
print (n,"\n")
n = n+1 - Answers -20, 21, 22, 23, 24, 25
What will be displayed when the following code is executed?
number = 6
while number > 0:
number -= 3
print(number, end = ' ') - Answers -3 0
The input function returns a Boolean if the user types in T or false - Answers -False
While loops are pretest loops T or F - Answers -True
sum_total is a legal Python identifier T or F - Answers -True
If you enter a bunch of letters in response to the input function, the input function returns
a string. T or F - Answers -True
Computers can create true random numbers T or F - Answers -False
String can be used as a sequence in a for loop T or F - Answers -True
in is a reserved word in Python T or F - Answers -True
In python, the division operator (/) gives a float result, even if both of the numbers are
integers T or F - Answers -True
if is a legal Python identifier T or F - Answers -False
The int function can be used to convert a string of digits into an integer T or F -
Answers -True
Which character starts a comment in a Python program?
$
#
%
& - Answers -#
What is the output of the following code?
n = 20
while (n <= 25):
print (n,"\n")
n = n+1 - Answers -20, 21, 22, 23, 24, 25
What will be displayed when the following code is executed?
number = 6
while number > 0:
number -= 3
print(number, end = ' ') - Answers -3 0