D335 INTRODUCTION TO
PROGRAMMING IN PYTHON PRE-
ASSESSMENT & PERFORMANCE
ASSESSMENT PRACTICE EXAM
QUESTIONS AND CORRECT ANSWERS
(VERIFIED ANSWERS) PLUS RATIONALES
2026 Q&A | INSTANT DOWNLOAD PDF.
Core Domains:
Python Fundamentals and Syntax
Variables, Data Types, and Operators
Input/Output Operations (print(), input())
Control Flow (if/elif/else conditional statements)
Iteration (for loops, while loops)
Functions and Modular Programming
Data Structures (Lists, Tuples, Dictionaries, Sets)
String Manipulation and Methods
File Handling (Reading from and Writing to Files)
Exception Handling (try/except blocks)
List Comprehensions and Advanced Operations
Object-Oriented Programming Basics (Classes and Objects)
Introduction
This comprehensive examination is designed to evaluate the candidate's
mastery of introductory Python programming concepts essential for
success in the D335 course and the Objective Assessment (OA). The
assessment covers Python fundamentals, variables and data types, control
flow, loops, functions, data structures, string manipulation, file handling,
and exception handling. Through a combination of multiple-choice
questions, code snippet analysis, and scenario-based problems,
,candidates will demonstrate their ability to read, write, and debug Python
code, apply programming logic to solve problems, and understand key
Python concepts. Special emphasis is placed on practical coding skills,
common pitfalls, and the application of Python in real-world scenarios.
SECTION ONE: QUESTIONS 1-100
Question 1
What is the output of the following Python code?
python
print(type(3.14))
A. <class 'int'>
B. <class 'float'>
C. <class 'str'>
D. <class 'bool'>
B. <class 'float'>
RATIONALE: The type() function returns the data type of the
argument. 3.14 is a floating-point number, so type(3.14) returns <class
'float'>. Integers are whole numbers without a decimal point, strings are
text enclosed in quotes, and booleans are True or False.
Question 2
Which of the following is an immutable data type in Python?
A. List
B. Dictionary
C. Tuple
D. Set
C. Tuple
, RATIONALE: Tuples are immutable, meaning their elements cannot
be changed after creation. Lists, dictionaries, and sets are mutable and
can be modified after creation.
Question 3
What is the output of the following code?
python
x=5
y=2
print(x // y)
A. 2.5
B. 2
C. 3
D. 2.0
B. 2
RATIONALE: The // operator performs floor division, which divides
the first number by the second and rounds down to the nearest whole
number. 5 // 2 equals 2. The / operator would return 2.5.
Question 4
Which of the following correctly creates an empty list in Python?
A. list = ()
B. list = []
C. list = {}
D. list = [ ]
B. list = []
, RATIONALE: An empty list is created using square brackets [].
Parentheses () create an empty tuple, and curly braces {} create an
empty dictionary.
Question 5
What is the output of the following code?
python
print("Hello" + " " + "World")
A. HelloWorld
B. Hello World
C. "Hello World"
D. Hello + World
B. Hello World
RATIONALE: The + operator concatenates strings. "Hello" + " " +
"World" results in the string "Hello World" with a space between the
words.
Question 6
Which statement is used to handle exceptions in Python?
A. catch
B. except
C. error
D. handle
B. except
RATIONALE: Exceptions in Python are handled
using try and except blocks. The except block catches and handles
exceptions that occur in the try block.
PROGRAMMING IN PYTHON PRE-
ASSESSMENT & PERFORMANCE
ASSESSMENT PRACTICE EXAM
QUESTIONS AND CORRECT ANSWERS
(VERIFIED ANSWERS) PLUS RATIONALES
2026 Q&A | INSTANT DOWNLOAD PDF.
Core Domains:
Python Fundamentals and Syntax
Variables, Data Types, and Operators
Input/Output Operations (print(), input())
Control Flow (if/elif/else conditional statements)
Iteration (for loops, while loops)
Functions and Modular Programming
Data Structures (Lists, Tuples, Dictionaries, Sets)
String Manipulation and Methods
File Handling (Reading from and Writing to Files)
Exception Handling (try/except blocks)
List Comprehensions and Advanced Operations
Object-Oriented Programming Basics (Classes and Objects)
Introduction
This comprehensive examination is designed to evaluate the candidate's
mastery of introductory Python programming concepts essential for
success in the D335 course and the Objective Assessment (OA). The
assessment covers Python fundamentals, variables and data types, control
flow, loops, functions, data structures, string manipulation, file handling,
and exception handling. Through a combination of multiple-choice
questions, code snippet analysis, and scenario-based problems,
,candidates will demonstrate their ability to read, write, and debug Python
code, apply programming logic to solve problems, and understand key
Python concepts. Special emphasis is placed on practical coding skills,
common pitfalls, and the application of Python in real-world scenarios.
SECTION ONE: QUESTIONS 1-100
Question 1
What is the output of the following Python code?
python
print(type(3.14))
A. <class 'int'>
B. <class 'float'>
C. <class 'str'>
D. <class 'bool'>
B. <class 'float'>
RATIONALE: The type() function returns the data type of the
argument. 3.14 is a floating-point number, so type(3.14) returns <class
'float'>. Integers are whole numbers without a decimal point, strings are
text enclosed in quotes, and booleans are True or False.
Question 2
Which of the following is an immutable data type in Python?
A. List
B. Dictionary
C. Tuple
D. Set
C. Tuple
, RATIONALE: Tuples are immutable, meaning their elements cannot
be changed after creation. Lists, dictionaries, and sets are mutable and
can be modified after creation.
Question 3
What is the output of the following code?
python
x=5
y=2
print(x // y)
A. 2.5
B. 2
C. 3
D. 2.0
B. 2
RATIONALE: The // operator performs floor division, which divides
the first number by the second and rounds down to the nearest whole
number. 5 // 2 equals 2. The / operator would return 2.5.
Question 4
Which of the following correctly creates an empty list in Python?
A. list = ()
B. list = []
C. list = {}
D. list = [ ]
B. list = []
, RATIONALE: An empty list is created using square brackets [].
Parentheses () create an empty tuple, and curly braces {} create an
empty dictionary.
Question 5
What is the output of the following code?
python
print("Hello" + " " + "World")
A. HelloWorld
B. Hello World
C. "Hello World"
D. Hello + World
B. Hello World
RATIONALE: The + operator concatenates strings. "Hello" + " " +
"World" results in the string "Hello World" with a space between the
words.
Question 6
Which statement is used to handle exceptions in Python?
A. catch
B. except
C. error
D. handle
B. except
RATIONALE: Exceptions in Python are handled
using try and except blocks. The except block catches and handles
exceptions that occur in the try block.