WGU D522 (WEN1) Task 1 Performance Assessment
| Incident Response & DNS Remediation | Python,
GitLab, Device Inventory, Email, Helpdesk AP 2026
Updates
Domain 1: Python Fundamentals & Scripting Basics
Q1. Which programming paradigm focuses on describing a sequence of steps to
perform a task, making it foundational to scripting and automation?
A. Object-Oriented Programming
B. Functional Programming
C. Imperative/Procedural Programming
D. Declarative Programming
Correct Answer: C
Rationale: Imperative or procedural programming is characterized by a step-by-step
sequence of instructions that change the program's state. This approach is foundational
to scripting and automation, where tasks are broken down into a series of explicit
commands executed in order.
Q2. What is a key trait of Object-Oriented Programming (OOP) that is particularly
effective for complex automation systems?
A. Describes what the program should accomplish without specifying how
B. Organizes code around objects that encapsulate data and behavior
C. Defines a set of logical conditions and lets the system deduce solutions
D. Focuses on using functions and immutable data for computation
Correct Answer: B
Rationale: OOP models real-world entities as "objects" that contain both data
(attributes) and behavior (methods). This encapsulation promotes modularity,
,reusability, and is particularly effective for complex automation systems where
components like network devices or servers can be represented as objects.
Q3. Python is known for being a multi-paradigm language. Which paradigms does
Python support?
A. Only Procedural Programming
B. Only Object-Oriented Programming
C. Imperative, Object-Oriented, and Functional
D. Only Functional and Declarative
Correct Answer: C
Rationale: Python is a versatile language that supports multiple programming styles.
Developers can write procedural scripts, build complex class hierarchies using OOP, and
employ functional programming techniques with features like lambda functions, map(),
and filter().
Q4. What does the len() function return when used with a string?
A. The number of characters excluding spaces
B. The total number of characters including spaces
C. The number of words
D. The number of letters only
Correct Answer: B
Rationale: The len() function returns the total number of characters in a string,
including spaces, punctuation, etc..
Q5. What is the purpose of try and except in Python?
A. To define functions
B. To repeat a block of code
C. To handle exceptions and prevent crashes
D. To import modules
Correct Answer: C
Rationale: The try/except block helps catch and handle exceptions gracefully,
preventing the program from crashing unexpectedly.
,Q6. Which keyword is used to define a function in Python?
A. func
B. def
C. lambda
D. function
Correct Answer: B
Rationale: Functions in Python are defined using the def keyword.
Q7. What is the output of the following code? print(2 ** 3)
A. 6
B. 8
C. 5
D. 9
Correct Answer: B
Rationale: The ** operator performs exponentiation: 23=823=8.
Q8. Which method converts all characters in a string to uppercase?
A. capitalize()
B. casefold()
C. swapcase()
D. upper()
Correct Answer: D
Rationale: The .upper() method converts all alphabetic characters in a string to
uppercase.
Q9. What is the output of the following code?
python
x = [1, 2, 3]
x.append(4)
print(x)
, A. [1, 2, 3]
B. [4, 1, 2, 3]
C. [1, 2, 3, 4]
D. [1, 2, 3][4]
Correct Answer: C
Rationale: The append() method adds an item to the end of a list.
Q10. What is the purpose of the is operator in Python?
A. To check if two values are equal
B. To check if two variables refer to the same object in memory
C. To check if a variable is of a certain type
D. To check if a value is contained in a sequence
Correct Answer: B
Rationale: The is operator performs an identity comparison, returning True if both
operands reference the same object in memory. This is distinct from the == operator,
which checks for value equality.
Q11. What is the primary purpose of indentation in Python?
A. To make the code look more organized
B. To define blocks of code and scope
C. To separate statements from expressions
D. To indicate comments
Correct Answer: B
Rationale: Python uses indentation to define blocks of code, unlike many other
languages that use braces or keywords. Indentation determines the scope of control
flow statements, functions, and classes.
Q12. Which built-in Python function is used to capture user input from the
console?
A. print()
B. format()
C. input()
| Incident Response & DNS Remediation | Python,
GitLab, Device Inventory, Email, Helpdesk AP 2026
Updates
Domain 1: Python Fundamentals & Scripting Basics
Q1. Which programming paradigm focuses on describing a sequence of steps to
perform a task, making it foundational to scripting and automation?
A. Object-Oriented Programming
B. Functional Programming
C. Imperative/Procedural Programming
D. Declarative Programming
Correct Answer: C
Rationale: Imperative or procedural programming is characterized by a step-by-step
sequence of instructions that change the program's state. This approach is foundational
to scripting and automation, where tasks are broken down into a series of explicit
commands executed in order.
Q2. What is a key trait of Object-Oriented Programming (OOP) that is particularly
effective for complex automation systems?
A. Describes what the program should accomplish without specifying how
B. Organizes code around objects that encapsulate data and behavior
C. Defines a set of logical conditions and lets the system deduce solutions
D. Focuses on using functions and immutable data for computation
Correct Answer: B
Rationale: OOP models real-world entities as "objects" that contain both data
(attributes) and behavior (methods). This encapsulation promotes modularity,
,reusability, and is particularly effective for complex automation systems where
components like network devices or servers can be represented as objects.
Q3. Python is known for being a multi-paradigm language. Which paradigms does
Python support?
A. Only Procedural Programming
B. Only Object-Oriented Programming
C. Imperative, Object-Oriented, and Functional
D. Only Functional and Declarative
Correct Answer: C
Rationale: Python is a versatile language that supports multiple programming styles.
Developers can write procedural scripts, build complex class hierarchies using OOP, and
employ functional programming techniques with features like lambda functions, map(),
and filter().
Q4. What does the len() function return when used with a string?
A. The number of characters excluding spaces
B. The total number of characters including spaces
C. The number of words
D. The number of letters only
Correct Answer: B
Rationale: The len() function returns the total number of characters in a string,
including spaces, punctuation, etc..
Q5. What is the purpose of try and except in Python?
A. To define functions
B. To repeat a block of code
C. To handle exceptions and prevent crashes
D. To import modules
Correct Answer: C
Rationale: The try/except block helps catch and handle exceptions gracefully,
preventing the program from crashing unexpectedly.
,Q6. Which keyword is used to define a function in Python?
A. func
B. def
C. lambda
D. function
Correct Answer: B
Rationale: Functions in Python are defined using the def keyword.
Q7. What is the output of the following code? print(2 ** 3)
A. 6
B. 8
C. 5
D. 9
Correct Answer: B
Rationale: The ** operator performs exponentiation: 23=823=8.
Q8. Which method converts all characters in a string to uppercase?
A. capitalize()
B. casefold()
C. swapcase()
D. upper()
Correct Answer: D
Rationale: The .upper() method converts all alphabetic characters in a string to
uppercase.
Q9. What is the output of the following code?
python
x = [1, 2, 3]
x.append(4)
print(x)
, A. [1, 2, 3]
B. [4, 1, 2, 3]
C. [1, 2, 3, 4]
D. [1, 2, 3][4]
Correct Answer: C
Rationale: The append() method adds an item to the end of a list.
Q10. What is the purpose of the is operator in Python?
A. To check if two values are equal
B. To check if two variables refer to the same object in memory
C. To check if a variable is of a certain type
D. To check if a value is contained in a sequence
Correct Answer: B
Rationale: The is operator performs an identity comparison, returning True if both
operands reference the same object in memory. This is distinct from the == operator,
which checks for value equality.
Q11. What is the primary purpose of indentation in Python?
A. To make the code look more organized
B. To define blocks of code and scope
C. To separate statements from expressions
D. To indicate comments
Correct Answer: B
Rationale: Python uses indentation to define blocks of code, unlike many other
languages that use braces or keywords. Indentation determines the scope of control
flow statements, functions, and classes.
Q12. Which built-in Python function is used to capture user input from the
console?
A. print()
B. format()
C. input()