WGU D522 V2 Task 1 & 2
Performance Assessment Exam
with verified answers and
rationale graded A+ updated 2026
new!!
Section 1: Python Fundamentals (Questions 1–20)
1. What is the output of the following code?
python
Copy
Download
print("5" + "3")
A. 8
B. 53
C. 15
D. Error
Correct Answer: B
Rationale: String concatenation joins the two strings "5" and "3" to produce "53".
The + operator performs concatenation when both operands are strings, not
arithmetic addition -3 .
2. Which data type is immutable in Python?
A. List
B. Dictionary
C. Tuple
D. Set
Correct Answer: C
Rationale: Tuples are ordered and unchangeable (immutable). Lists, dictionaries, and
sets are mutable data structures whose contents can be modified after creation -7-
14 .
3. What does len("Hello") return?
,A. 4
B. 5
C. 6
D. Error
Correct Answer: B
Rationale: The len() function returns the number of characters in a string. The string
"Hello" contains five characters: H, e, l, l, o -3-14 .
4. 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 -3 .
5. What is the result of the expression 3 ** 2?
A. 6
B. 8
C. 9
D. 12
Correct Answer: C
Rationale: The ** operator in Python performs exponentiation. Thus, 3 ** 2 is
equivalent to 3 raised to the power of 2, which equals 9 -14 .
6. Which keyword is used to define a function in Python?
A. func
B. def
C. function
D. define
Correct Answer: B
Rationale: Functions in Python are defined using the def keyword followed by the
function name and parentheses -1-3 .
, 7. What will be the result of the expression 5 + 3 * 2?
A. 16
B. 13
C. 11
D. 10
Correct Answer: C
Rationale: Python follows standard operator precedence rules. The multiplication
operator (*) has higher precedence than addition (+), so 3 * 2 is evaluated first to yield
6, and then 5 + 6 results in 11 -14 .
8. What is the output of the following code?
python
Copy
Download
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. After appending 4,
the list becomes [1, 2, 3, 4] -3 .
9. What is the purpose of the strip() method?
A. Removes leading and trailing whitespace
B. Removes all spaces from a string
C. Splits a string into a list
D. Converts a string to lowercase
Correct Answer: A
Rationale: The strip() method removes leading and trailing whitespace from a string.
This is a common operation when processing user input or reading data from files -1 .
10. Which of the following is used for string formatting in Python?
Performance Assessment Exam
with verified answers and
rationale graded A+ updated 2026
new!!
Section 1: Python Fundamentals (Questions 1–20)
1. What is the output of the following code?
python
Copy
Download
print("5" + "3")
A. 8
B. 53
C. 15
D. Error
Correct Answer: B
Rationale: String concatenation joins the two strings "5" and "3" to produce "53".
The + operator performs concatenation when both operands are strings, not
arithmetic addition -3 .
2. Which data type is immutable in Python?
A. List
B. Dictionary
C. Tuple
D. Set
Correct Answer: C
Rationale: Tuples are ordered and unchangeable (immutable). Lists, dictionaries, and
sets are mutable data structures whose contents can be modified after creation -7-
14 .
3. What does len("Hello") return?
,A. 4
B. 5
C. 6
D. Error
Correct Answer: B
Rationale: The len() function returns the number of characters in a string. The string
"Hello" contains five characters: H, e, l, l, o -3-14 .
4. 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 -3 .
5. What is the result of the expression 3 ** 2?
A. 6
B. 8
C. 9
D. 12
Correct Answer: C
Rationale: The ** operator in Python performs exponentiation. Thus, 3 ** 2 is
equivalent to 3 raised to the power of 2, which equals 9 -14 .
6. Which keyword is used to define a function in Python?
A. func
B. def
C. function
D. define
Correct Answer: B
Rationale: Functions in Python are defined using the def keyword followed by the
function name and parentheses -1-3 .
, 7. What will be the result of the expression 5 + 3 * 2?
A. 16
B. 13
C. 11
D. 10
Correct Answer: C
Rationale: Python follows standard operator precedence rules. The multiplication
operator (*) has higher precedence than addition (+), so 3 * 2 is evaluated first to yield
6, and then 5 + 6 results in 11 -14 .
8. What is the output of the following code?
python
Copy
Download
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. After appending 4,
the list becomes [1, 2, 3, 4] -3 .
9. What is the purpose of the strip() method?
A. Removes leading and trailing whitespace
B. Removes all spaces from a string
C. Splits a string into a list
D. Converts a string to lowercase
Correct Answer: A
Rationale: The strip() method removes leading and trailing whitespace from a string.
This is a common operation when processing user input or reading data from files -1 .
10. Which of the following is used for string formatting in Python?