Answer Key (True/False):
Python is a low-level programming language.
Answer: False
Python source code files use the .py
extension.
Answer: True
The print
function in Python can only output strings.
Answer: False
The default separator between multiple values in the print
function is a space.
Answer: True
The end
parameter in the print
function changes the default newline character.
Answer: True
In Python, indentation is optional for defining the scope of code blocks.
Answer: False
A syntax error occurs when the Python interpreter encounters code that violates the language’s rules.
Answer: True
The escape sequence \n
is used to insert a tab character in a string.
Answer: False
Python automatically closes a file when using the with open()
statement.
Answer: True
Comments in Python are executed by the interpreter.
Answer: False
Multi-line comments in Python are enclosed in triple quotes ("""
or '''
).
Answer: True
The os
module in Python is used for mathematical operations.
Answer: False
The sep
parameter in the print
function specifies how to separate multiple values.
Answer: True
The print
function can write output to a file instead of the console.
Answer: True
Python uses braces {}
to define code blocks.
Answer: False
The \t
escape sequence is used to insert a tab space in a string.
Answer: True
A run-time error occurs during the execution of a program.
Answer: True
The f-string
formatting method in Python is available in all versions of Python.
Answer: False (It was introduced in Python 3.6)
The print(f"{a=}")
syntax displays both the variable name and its value.
Answer: True
Python’s indentation system improves code readability and reduces errors.
Answer: True
An indentation error in Python is considered a syntax error.
Answer Key (True/False):