ENVIRONMENT, SYNTAX, AND I/O EXAM 2026
What are the two execution modes provided by Python? - ANSWER-Interactive
REPL Mode and Script Mode.
How does the Interactive REPL Mode operate? - ANSWER-Reads one
statement at a time, runs it immediately, and waits for the next line.
How do you launch a Python script in Script Mode? - ANSWER-Type python
script_name.py in the terminal.
What is the persistence of code in Interactive REPL Mode? - ANSWER-
Temporary; code disappears when the terminal session closes.
What is the feedback loop in Interactive REPL Mode? - ANSWER-Instant,
zero-delay evaluation for immediate discovery.
What is the REPL cycle in Interactive Mode? - ANSWER-Read, Evaluate,
Print, Loop.
What is the best use case for Script Mode? - ANSWER-Real-world
applications, homework submissions, automation scripts.
What command starts the Python REPL on Windows? - ANSWER-Type
'python' in the terminal.
,What indicates that Python is idle and ready for input in the REPL? -
ANSWER-The primary prompt '>>>'.
What does the input() function do in Python? - ANSWER-The input() function
pauses program execution and prompts the user to enter data via the keyboard.
What is a common mistake when using the input() function? - ANSWER-A
common mistake is forgetting that input() always returns a string, even if the
user types digits.
How can you perform arithmetic calculations on user inputs in Python? -
ANSWER-You must explicitly cast the input strings to numeric types using
int() or float().
What is an f-string in Python? - ANSWER-An f-string is a formatted string
literal that allows embedding expressions inside curly braces.
What is the purpose of the calculate_average function in the example? -
ANSWER-The calculate_average function calculates the arithmetic mean from
a list of numerical test scores.
What does the keyword module in Python do? - ANSWER-The keyword
module provides a list of reserved keywords in Python.
What is the output of the print statement 'print('Line 1
Line 2')'? - ANSWER-The output will be two lines: 'Line 1' and 'Line 2'.
What is the purpose of the 'sep' parameter in the print() function? - ANSWER-
The 'sep' parameter specifies the string to be inserted between the values,
instead of the default space.
, What does the statement 'print(f'Student: {student_name} | Assessed Tuition:
Php {total_tuition:.2f}')' do? - ANSWER-It prints a formatted string showing
the student's name and assessed tuition, formatted to two decimal places.
What happens if you try to use a reserved keyword as a variable name? -
ANSWER-You will get a syntax error, as reserved keywords cannot be used as
identifiers.
What is the significance of the 'return' statement in a function? - ANSWER-The
'return' statement exits the function and optionally passes back an expression to
the caller.
What is the output of 'print('C:\Users\Student')'? - ANSWER-The output will be
'C:\
What does the 'flush' parameter do in the print() function? - ANSWER-The
'flush' parameter, when set to True, forces the output to be written to the stream
immediately.
What does the secondary prompt '...' signify in the REPL? - ANSWER-It
indicates that a multi-line statement is being opened.
What command exits the REPL cleanly in Python 3.13? - ANSWER-Type 'exit'
or 'quit' and press Enter.
What is the purpose of the 'help()' function in Python? - ANSWER-It displays
the official documentation for any built-in function or module.
What does the 'dir()' function do? - ANSWER-It lists all attributes, methods,
and functions available on an object.