CNIT 155 LATEST 2026 TEST PAPER QUESTIONS AND
SOLUTIONS RATED A+
✔✔Which is the output of the following code?
x = John
print("Hello ", x) - ✔✔Hello John
✔✔Which of the following is a proper name for a variable?
A. True
B. StudentID
C. Class Roster
D. 1studentname - ✔✔B. StudentID
✔✔What is the output of the following code?
Output =
print(int(Output)) - ✔✔5
✔✔Boolean values are case sensitive T/F - ✔✔True
✔✔The print function does not return a value T/F - ✔✔True
✔✔Which of the following import statements is correct to use math functions?
A. import math from *
B. import math
C. from * import math
D. from math import all - ✔✔B. import math
✔✔The ^ operator is the same as the ** operator in Python. T/F - ✔✔False
✔✔What is the output of the following code?
StudentIDJohn = 84219643
StudentIDEmily = 41305431
print(str(StudentIDJohn) + " " + str(StudentIDEmily)) - ✔✔84219643 41305431
✔✔Which of the following will increment the data variable by 4?
A. data %= 4
B. data += 4
C. data = 4
D. data *= 4 - ✔✔B. data += 4
✔✔7%3 is the same as 7//3. T/F - ✔✔False
, ✔✔Any inputted data is considered string data, regardless of what the user inputted.
T/F - ✔✔True
✔✔Which of the following is a valid identifier in Python?
A. first-name
B. radius 3
C. vel12city
D. 1smith - ✔✔C. vel12ciry
✔✔Which data type is 19.256?
A. integer
B. string
C. float
D. list - ✔✔C. float
✔✔Which of the following is NOT a rule for naming an identifier?
A. The name must not be a reserved/keyword.
B. Starts with a letter, underscore, or number, followed by a sequence of letters, digits,
and underscores.
C. It must not include a space.
D. The name is case sensitive. - ✔✔B. Starts with a letter, underscore, or number,
followed by a sequence of letters, digits, and underscores.
✔✔Evaluate 10 % 3.
A. 1
B. 3.33
C. 30
D. 3 - ✔✔A. 1
✔✔Which expression is written correctly?
A. 2x
B. 3(2a)
C. 3(4 + 3)
D. 5 * (7 + 4) - ✔✔D. 5 * (7 + 4)
✔✔Which of the following is equal to n = n - 2?
A. n =- 2
B. n -= 2
C. n = -2
D. n = 2 - 2 - ✔✔B. n -= 2
✔✔The expression (2 + * 3) results in an integer value. T/F - ✔✔False
✔✔Evaluate 12 + (3 ** 2) - ✔✔21
SOLUTIONS RATED A+
✔✔Which is the output of the following code?
x = John
print("Hello ", x) - ✔✔Hello John
✔✔Which of the following is a proper name for a variable?
A. True
B. StudentID
C. Class Roster
D. 1studentname - ✔✔B. StudentID
✔✔What is the output of the following code?
Output =
print(int(Output)) - ✔✔5
✔✔Boolean values are case sensitive T/F - ✔✔True
✔✔The print function does not return a value T/F - ✔✔True
✔✔Which of the following import statements is correct to use math functions?
A. import math from *
B. import math
C. from * import math
D. from math import all - ✔✔B. import math
✔✔The ^ operator is the same as the ** operator in Python. T/F - ✔✔False
✔✔What is the output of the following code?
StudentIDJohn = 84219643
StudentIDEmily = 41305431
print(str(StudentIDJohn) + " " + str(StudentIDEmily)) - ✔✔84219643 41305431
✔✔Which of the following will increment the data variable by 4?
A. data %= 4
B. data += 4
C. data = 4
D. data *= 4 - ✔✔B. data += 4
✔✔7%3 is the same as 7//3. T/F - ✔✔False
, ✔✔Any inputted data is considered string data, regardless of what the user inputted.
T/F - ✔✔True
✔✔Which of the following is a valid identifier in Python?
A. first-name
B. radius 3
C. vel12city
D. 1smith - ✔✔C. vel12ciry
✔✔Which data type is 19.256?
A. integer
B. string
C. float
D. list - ✔✔C. float
✔✔Which of the following is NOT a rule for naming an identifier?
A. The name must not be a reserved/keyword.
B. Starts with a letter, underscore, or number, followed by a sequence of letters, digits,
and underscores.
C. It must not include a space.
D. The name is case sensitive. - ✔✔B. Starts with a letter, underscore, or number,
followed by a sequence of letters, digits, and underscores.
✔✔Evaluate 10 % 3.
A. 1
B. 3.33
C. 30
D. 3 - ✔✔A. 1
✔✔Which expression is written correctly?
A. 2x
B. 3(2a)
C. 3(4 + 3)
D. 5 * (7 + 4) - ✔✔D. 5 * (7 + 4)
✔✔Which of the following is equal to n = n - 2?
A. n =- 2
B. n -= 2
C. n = -2
D. n = 2 - 2 - ✔✔B. n -= 2
✔✔The expression (2 + * 3) results in an integer value. T/F - ✔✔False
✔✔Evaluate 12 + (3 ** 2) - ✔✔21