ASSESSMENT ACTUAL EXAM PREP 2025/2026
QUESTIONS BANK AND CORRECT DETAILED ANSWERS
WITH RATIONALES || 100% GUARANTEED PASS
<RECENT VERSION>
1. What are the traits of Imperative/procedural programming? - ANSWER ✔
Focuses on describing a sequence of steps to perform a task
2. What are the traits of Object-Oriented Programming (OOP)? - ANSWER ✔
Organize code around objects, which encapsulate data and behavior.
3. What are the traits of Functional Programming? - ANSWER ✔ emphasizes
the use of functions and immutable data for computation.
4. What are the traits of Declarative Programming? - ANSWER ✔ describes
what the program should accomplish without specifying how to achieve it.
5. What are the traits of Event-Driven Programming? - ANSWER ✔ Reacts to
events and user actions, triggering corresponding functions.
6. What are the traits of Logic Programming? - ANSWER ✔ defines a set of
logical conditions and lets the system deduce solutions.
7. What does Python syntax refer to? - ANSWER ✔ The set of rules that
dictate the combinations of symbols and keywords that form valid Python
programs
8. What is the purpose of indentation in Python? - ANSWER ✔ To define
blocks of code
9. Why might a programmer use comments for 'Preventing Execution'? -
ANSWER ✔ To temporarily disable lines or blocks of code
,10.What is the primary use of whitespace in Python? - ANSWER ✔ To define
the structure and hierarchy of the code
11.What does Python use to define the scope of control flow statements and
structures like functions and classes? - ANSWER ✔ Indentation
12.What is the purpose of the input() function in Python? - ANSWER ✔ To
capture user input and store it as a string
13.pip - ANSWER ✔ The Python package installer used to download and
install packages from PyPI.
14.Edge cases - ANSWER ✔ Inputs that are at the extreme ends of input
ranges, used to test the robustness of code.
15.Temporary outputs - ANSWER ✔ Outputs added to code for debugging
purposes to help identify where issues may be occurring.
16.Logical errors - ANSWER ✔ Errors in code that cause it to operate
incorrectly, but do not produce syntax errors or runtime errors.
17.Blocking calls - ANSWER ✔ Calls in code that cause the program to wait
for an external resource or input before proceeding.
18.Function - ANSWER ✔ A block of code that performs a specific task and
can be reused throughout a program.
19.Execution - ANSWER ✔ The process of running a program or code.
20.Trace execution - ANSWER ✔ The act of following the flow of execution in
a program to identify where it may be failing.
21.Test cases - ANSWER ✔ Specific conditions under which a unit test is run
to verify that the code behaves as expected.
22.requests - ANSWER ✔ A library for making HTTP requests in Python.
,23.Paramiko - ANSWER ✔ A library for SSH and SFTP automation,
commonly used for network automation.
24.import module - ANSWER ✔ Imports the module as a whole, requiring the
module name as a prefix to access its attributes.
25.from module import name - ANSWER ✔ Imports a specific attribute from
the module directly into your namespace, allowing its use without the
module prefix.
26.os - ANSWER ✔ A standard library for interacting with the Operating
System, including file paths and environment variables.
27.sys - ANSWER ✔ A standard library for system-specific parameters and
functions, such as accessing command-line arguments.
28.subprocess - ANSWER ✔ A library for running external commands and
programs from Python and capturing their output.
29.Which function should be used to add data to a file, such as a network
configuration file?
- ANSWER ✔ write()
30.Based on the Python code snippet:
def greet(name, greeting = "Welcome to WGU"):
return f"{greeting}, {name}!"
What is the purpose of the first line of code? - ANSWER ✔
To define a function with a default greeting
31.This Python code snippet returns a syntax error when run:
def multiply_numbers(num1, num2)
result = num1 * num2
return result
num1 = 5
, num2 = 8
print(multiply_numbers(num1, num2))
Which code adjustment will resolve the syntax error? - ANSWER ✔
Add a colon after def multiply_numbers(num1, num2).
32.Based on the Python snippet:
devices = ["router01", "switch01", "modem01", "gateway01", "printer01"]
Which data structure is being used to store the names for various types of
devices within devices? - ANSWER ✔
List
33.Based on the Python snippet:
value = input("Enter a number: ")
result = int(value) + 10
print(result)
What purpose does result = int(value) + 10 serve? - ANSWER ✔
Converts the user's input into an integer and sums it
34.A developer is creating a Python script to capture metrics for different
network interfaces on a router, with each set of metrics treated as a single,
immutable record. The stored record will represent a snapshot of metrics for
a specific network interface at a given point in time to capture historical
records for future analysis.
Which data structure should be used to store the recorded metrics based on
the specifications?
35.Based on the Python list:
numbers = [10, 20, 30, 40]
What is the index position of the element "40"?- ANSWER ✔