Exam Practice Test Complete Questions with
Verified Correct Answers & Detailed Rationales |
Graded A+ | Updated 2026
Leave your honest rating⭐⭐⭐⭐⭐
QUESTION 1
What are the traits of imperative/procedural programming?
A. Organizes code around objects that encapsulate data and behavior
B. Emphasizes the use of functions and immutable data for computation
C. Focuses on describing a sequence of steps to perform a task
D. Describes what the program should accomplish without specifying how to
achieve it
Rationale: Imperative/procedural programming focuses on describing a sequence
of steps to perform a task. This paradigm uses statements that change a program's
state through assignments and control flow structures like loops and conditionals.
QUESTION 2
What are the traits of Object-Oriented Programming (OOP)?
A. Focuses on describing a sequence of steps to perform a task
B. Organizes code around objects, which encapsulate data and behavior
C. Emphasizes the use of functions and immutable data for computation
D. Reacts to events and user actions, triggering corresponding functions
Rationale: Object-Oriented Programming organizes code around objects, which
encapsulate data and behavior. OOP promotes concepts like inheritance,
polymorphism, and encapsulation, making code more modular and reusable.
QUESTION 3
,What are the traits of Functional Programming?
A. Organizes code around objects that encapsulate data and behavior
B. Focuses on describing a sequence of steps to perform a task
C. Emphasizes the use of functions and immutable data for computation
D. Defines a set of logical conditions and lets the system deduce solutions
Rationale: Functional programming emphasizes the use of functions and
immutable data for computation. This paradigm avoids side effects and mutable
state, promoting predictable and testable code.
QUESTION 4
What are the traits of Declarative Programming?
A. Focuses on describing a sequence of steps to perform a task
B. Organizes code around objects that encapsulate data and behavior
C. Emphasizes the use of functions and immutable data for computation
D. Describes what the program should accomplish without specifying how to
achieve it
Rationale: Declarative programming describes what the program should
accomplish without specifying how to achieve it. SQL and HTML are examples of
declarative languages where you specify the desired outcome rather than the step-
by-step procedure.
QUESTION 5
What are the traits of Event-Driven Programming?
A. Focuses on describing a sequence of steps to perform a task
B. Organizes code around objects that encapsulate data and behavior
C. Reacts to events and user actions, triggering corresponding functions
D. Emphasizes the use of functions and immutable data for computation
Rationale: Event-driven programming reacts to events and user actions, triggering
corresponding functions. This paradigm is common in graphical user interfaces and
server applications where the flow of the program is determined by events.
,QUESTION 6
What does Python syntax refer to?
A. The built-in functions available in Python
B. The set of rules that dictate the combinations of symbols and keywords that
form valid Python programs
C. The libraries included in the Python standard library
D. The execution model of Python programs
Rationale: Python syntax refers to the set of rules that dictate the combinations of
symbols and keywords that form valid Python programs. Syntax defines how code
must be written to be interpreted correctly by the Python interpreter.
QUESTION 7
What is the purpose of indentation in Python?
A. To make the code look visually appealing
B. To define blocks of code
C. To separate variables from functions
D. To indicate comments
Rationale: Indentation is used in Python to define blocks of code. Unlike many
other languages that use braces or keywords, Python uses whitespace indentation
to indicate which statements belong to which control structure, function, or class.
QUESTION 8
What is the primary use of whitespace in Python?
A. To separate statements on the same line
B. To define the structure and hierarchy of the code
C. To improve execution speed
D. To indicate comments
Rationale: The primary use of whitespace in Python is to define the structure and
hierarchy of the code. Consistent indentation is required for the code to execute
correctly, making Python code both readable and syntactically meaningful.
, QUESTION 9
What does Python use to define the scope of control flow statements and structures
like functions and classes?
A. Curly braces {}
B. Keywords like BEGIN and END
C. Indentation
D. Parentheses ()
Rationale: Python uses indentation to define the scope of control flow statements
and structures like functions and classes. The level of indentation determines
which statements belong to which block, eliminating the need for explicit scope
delimiters.
QUESTION 10
What is the purpose of the input() function in Python?
A. To output text to the console
B. To capture user input and store it as a string
C. To read data from a file
D. To convert data types
Rationale: The input() function captures user input from the console and stores it
as a string. This is essential for creating interactive scripts that respond to user
input.
QUESTION 11
What does the print() function do in Python?
A. Reads user input from the console
B. Outputs text or variables to the console
C. Determines the length of a sequence
D. Returns the type of an object