Intro To Python Exam Study Questions
with Correct Answers Top Graded 2025
Which of the following is NOT a reserved keyword in Python?
A. return
B. finally
C. start
D. class -Correct Answer ✔C. start
What is true of arithmetic statements in Python?
A. The Python interpreter always works from left to right with no regard for order of
operations.
B. Order of operations, including parentheses, is respected
C. Parentheses cannot be used to enforce operational order
D. Exponentiation is not guaranteed to occur before multiplication because they rely on
similar characters. -Correct Answer ✔B. Order of operations, including parentheses, is
respected
What is different about running a program as a script by sending a Python file to the
Python interpreter versus running commands directly in the Python shell?
A. In script mode, the output of each command will not be output to the screen.
B. When running in the Python shell numbers do not need to be converted to strings
contextually.
C. Print statements are ignored when running in the Python shell.
D. You cannot debug a program in script mode. -Correct Answer ✔A. In script mode,
the output of each command will not be output to the screen.
Which of the following is true of strings in Python?
A. They do not require quotes.
B. All normal arithmetic operators work on strings.
C. They can be combined with numeric data without conversion.
D. They can be surrounded by single or double quotes. -Correct Answer ✔D. They can
be surrounded by single or double quotes.
The process of combining two strings is called...
A. string addition
B. concatenation
C. joining
D. assignment -Correct Answer ✔B. concatenation
Python is an example of what kind of programming language?
A. Compiled
B. Interpreted
C. Natural
intro to python
,intro to python
D. Binary -Correct Answer ✔B. Interpreted
An expression is different from a statement because...
A. an expression cannot be used in script mode but a statement can be.
B. a statement cannot be used in script mode but an expression can be.
C. an expression produces an effect on the program and a statement does not.
D. a statement produces an effect on the program and an expression does not. -Correct
Answer ✔D. a statement produces an effect on the program and an expression does
not.
In the following expression, what best describes the relationship between
number_of_students and the value 29:
number_of_students = 29
A. number_of_students is a constant identified by 29
B. 29 is assigned to number_of_students
C. 29 is a constant identified by number_of_students
D. 29 is equivalent to number of students -Correct Answer ✔B. 29 is assigned to
number_of_students
What is true of variable names in Python?
A. They cannot begin with an uppercase letter.
B. They can include spaces
C. Numbers can be used anywhere in the variable name.
D. They are case sensitive. -Correct Answer ✔D. They are case sensitive.
In a Python program the type of which of the following values are the same?
10
10.0
'10'
A. None are the same.
B. The first two are the same.
C. All are the same.
D. The second two are the same -Correct Answer ✔A. None are the same.
When a piece of data is converted from one type to another type it is called...
A. conversion
B. concatenation
C. polymorphism
D. type casting -Correct Answer ✔D. type casting
Why is it a bad idea to use words such as print and other Python built in functions as
variable names?
A. Python will reset your variables while the program is running.
B. It makes the meaning of the code ambiguous.
C. Python will fail with an error if you try to do this.
intro to python
, intro to python
D. It will overwrite the original value of the function and make it impossible to use that
function again. -Correct Answer ✔D. It will overwrite the original value of the function
and make it impossible to use that function again.
Which of the following operations is allowed to be used with string data?
A. -
B. *
C. **
D. / -Correct Answer ✔B. *
When is It possible to perform addition on two different types of data using the "+" sign
operator in Python?
A. When one value is a number and one is a string representation of a number.
B. When both are numeric types.
C. This is never allowed without an explicit conversion of both values.
D. Python always allows this because it is loosely typed. -Correct Answer ✔B. When
both are numeric types.
When capturing user input in Python which of the following is true?
A. Numeric input cannot be captured.
B. Python will always always attempt to convert the data into a number first and will
capture it as a string if that fails.
C. The type of data captured from the user's input will be inferred based on the context.
D. All user input will be captured as a string. -Correct Answer ✔D. All user input will be
captured as a string.
When a floating point number is converted to an integer how is the original value
changed?
A. It is rounded up or down depending on the current value.
B. It is truncated leaving just the whole number portion.
C. The conversion will fail unless the decimal value is zero.
D. It is rounded up to the nearest whole number. -Correct Answer ✔B. It is truncated
leaving just the whole number portion.
Which of the following is NOT true of a statement in Python?
A. A statement can be used to change the value stored in a variable.
B. A simple line to print data is a statement.
C. Statements produce an effect on the program.
D. Statements only work with numeric data. -Correct Answer ✔D. Statements only work
with numeric data.
When attempting to convert a string value to an integer what will happen if a non-
numeric string is used?
A. A false value will be returned.
B. The number will be returned as zero.
C. The program will convert the ascii characters to numbers and return those.
intro to python