CNIT 155 TEST PAPER 2025/2026 QUESTIONS WITH
ANSWERS RATED A+
✔✔Python needs a main function to operate. T/F - ✔✔False
✔✔Which of the following is an example of a comment in python?
A. // This is a comment in python.
B. # This is a comment in python.
C. $ This is a comment in python
D. * This is a comment in python. - ✔✔B. # This is a comment in python.
✔✔Which of the following is an example of a boolean value?
A. "Welcome"
B. True
C. 23.546
D. 4 - ✔✔B. True
✔✔Which of the following is a legal variable name?
A. student name
B. student-name
C. 1studentname
D. studentname1 - ✔✔D. studentname1
✔✔print() is an example of an input T/F - ✔✔False
✔✔Which of the following is true about an integer?
A. True is an integer
B. An integer is a textual data type
C. An integer can contain decimals
D. An integer can be stored as a variable - ✔✔D. An integer can be stored as a variable
✔✔Rules of naming identifiers include the following, except:
A. Can include a space.
B. Starting with a letter or an underscore, followed by a sequence of letters, digits, and
underscores.
C. The name is case sensitive.
D. The name must not be a reserved/keyword. - ✔✔A. Can include a space.
✔✔What is the name of the python functions that tells you a class's type?
A. Type
B. Print
C. Define
D. Input - ✔✔A. Type
, ✔✔Values cannot be converted from one type to another T/F - ✔✔False
✔✔What is the value of the following expression?
9 + 3 * 2 ** 2 / (18-16) - ✔✔15
✔✔Which of the following operators has the highest priority in an expression?
A. +
B. /
C. ()
D. ** - ✔✔C. ()
✔✔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
ANSWERS RATED A+
✔✔Python needs a main function to operate. T/F - ✔✔False
✔✔Which of the following is an example of a comment in python?
A. // This is a comment in python.
B. # This is a comment in python.
C. $ This is a comment in python
D. * This is a comment in python. - ✔✔B. # This is a comment in python.
✔✔Which of the following is an example of a boolean value?
A. "Welcome"
B. True
C. 23.546
D. 4 - ✔✔B. True
✔✔Which of the following is a legal variable name?
A. student name
B. student-name
C. 1studentname
D. studentname1 - ✔✔D. studentname1
✔✔print() is an example of an input T/F - ✔✔False
✔✔Which of the following is true about an integer?
A. True is an integer
B. An integer is a textual data type
C. An integer can contain decimals
D. An integer can be stored as a variable - ✔✔D. An integer can be stored as a variable
✔✔Rules of naming identifiers include the following, except:
A. Can include a space.
B. Starting with a letter or an underscore, followed by a sequence of letters, digits, and
underscores.
C. The name is case sensitive.
D. The name must not be a reserved/keyword. - ✔✔A. Can include a space.
✔✔What is the name of the python functions that tells you a class's type?
A. Type
B. Print
C. Define
D. Input - ✔✔A. Type
, ✔✔Values cannot be converted from one type to another T/F - ✔✔False
✔✔What is the value of the following expression?
9 + 3 * 2 ** 2 / (18-16) - ✔✔15
✔✔Which of the following operators has the highest priority in an expression?
A. +
B. /
C. ()
D. ** - ✔✔C. ()
✔✔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