(VERIFIED ANSWERS) PLUS RATIONALES 2026 Q&A |LATEST EXAM UPDATE 2026/2027
SECTION ONE: QUESTIONS 1-100
Question 1
Which of the following is the correct way to create a virtual environment in Python 3 on a Windows system?
A. python3 -m venv myenv
B. python -m venv myenv
C. venv create myenv
D. virtualenv -p python3 myenv
🟢 B. python -m venv myenv
🔴 RATIONALE: On Windows, the Python executable is typically named python . The -m venv module is the
standard built-in tool for creating virtual environments. Option A uses python3 , which is common on
Linux/macOS, not Windows.
Question 2
What is the primary purpose of a try...except block in Python?
A. To create a new loop structure.
B. To define a new function.
C. To handle exceptions and prevent program crashes.
D. To import external libraries.
,🟢 C. To handle exceptions and prevent program crashes.
🔴 RATIONALE: try...except is used for exception handling, allowing a program to gracefully manage errors
and continue running, rather than terminating abruptly. It does not define functions, loops, or imports.
Question 3
Which command is used to install a package from the Python Package Index (PyPI) using pip?
A. pip get requests
B. pip install requests
C. pip download requests
D. pip add requests
🟢 B. pip install requests
🔴 RATIONALE: The correct syntax for installing a package with pip is pip install <package_name> . The other
options are not valid pip subcommands.
Question 4
Given the list my_list = [1, 2, 3, 4, 5] , what is the output of my_list[1:4] ?
A. [2, 3, 4]
B. [1, 2, 3]
C. [2, 3, 4, 5]
D. [1, 2, 3, 4]
🟢 A. [2, 3, 4]
🔴 RATIONALE: List slicing in Python is inclusive of the start index and exclusive of the end index. Therefore,
my_list[1:4] returns elements at indices 1, 2, and 3, which are 2, 3, and 4.
,Question 5
Which of the following is a mutable data type in Python?
A. int
B. str
C. tuple
D. list
🟢 D. list
🔴 RATIONALE: Lists are mutable, meaning their contents can be changed after creation. Integers, strings, and
tuples are immutable.
Question 6
A Python script needs to read a CSV file and perform an operation on each row. Which standard library module
is best suited for this task?
A. json
B. os
C. csv
D. sys
🟢 C. csv
🔴 RATIONALE: The csv module provides functionality for reading and writing CSV files. The json module is
for JSON, os for operating system interactions, and sys for system-specific parameters.
Question 7
What does the os.getcwd() function return?
A. The current working directory path.
, B. The name of the operating system.
C. A list of files in the current directory.
D. The current user's home directory.
🟢 A. The current working directory path.
🔴 RATIONALE: os.getcwd() (get current working directory) returns a string representing the path to the
current directory. It does not list files or return OS or user information.
Question 8
Which keyword is used to define a function in Python?
A. function
B. def
C. define
D. func
🟢 B. def
🔴 RATIONALE: def is the correct keyword to define a function in Python.
Question 9
What is the output of print(2 ** 3) ?
A. 6
B. 8
C. 9
D. 23