1
WGU D278 FINAL EXAM PREP SCRIPTING AND
PROGRAMMING 2026 JUST RELEASED 99% TOP SCORE
FREE DOWNLOAD PDF
Purpose
• Tests ability to write, debug, and analyze scripts in Python, Bash, PowerShell, or
JavaScript.
• Focuses on problem-solving, automation, and algorithmic thinking.
Format
• Multiple-choice, scenario-based coding, and script analysis.
• Questions involve predicting output, finding errors, or suggesting improvements.
Core Topics
1. Programming Basics: Variables, data types, operators, conditionals, loops.
2. Functions & Modular Code: Function definition, arguments, return values, scope.
3. Data Structures: Lists/arrays, dictionaries/maps, sets.
4. File Handling: Reading/writing files, parsing CSV/JSON.
5. Error Handling: Exceptions, debugging techniques.
6. Automation Scripts: Loops, file I/O, system commands.
7. Algorithms: Searching, sorting, string/number manipulation.
8. Basic OOP: Classes, objects, methods, attributes.
9. Best Practices: Readable code, comments, efficiency.
Exam Tips
• Practice predicting script outputs.
• Focus on common errors: loops, syntax, indentation.
• Understand logic and syntax differences across languages.
• Manage time on scenario-based questions.
,2
1.
Which of the following is the correct way to declare a variable in
Python?
A. var x = 10
B. x = 10
C. int x = 10
D. let x := 10
Answer: B
Rationale: Python does not require explicit type declaration; x = 10 is
correct.
2.
What is the output of the following Python code?
x = "5"
y=3
print(x * y)
A. 15
B. 555
C. 53
D. Error
,3
Answer: B
Rationale: Multiplying a string by an integer repeats the string; "5"*3 →
"555".
3.
Which statement correctly checks if a number n is between 10 and 20 in
Python?
A. if 10 < n < 20:
B. if n > 10 and n < 20:
C. Both A and B
D. if n in range(10, 20):
Answer: C
Rationale: Both A and B are valid ways to check the condition.
4.
What is the output of the following code?
for i in range(3):
print(i)
A. 1 2 3
B. 0 1 2
C. 0 1 2 3
D. 1 2
Answer: B
Rationale: range(3) produces 0, 1, 2.
, 4
5.
Which of the following defines a Python function that returns the
square of a number?
A. def square(x): return x*x
B. def square(x) x*x
C. function square(x) {return x*x}
D. def square x: return x*x
Answer: A
Rationale: Correct Python function syntax requires def and proper
colon/return usage.
6.
Given the list lst = [1, 2, 3, 4], what is the result of lst[1:3]?
A. [1, 2]
B. [2, 3]
C. [2, 3, 4]
D. [1, 2, 3]
Answer: B
Rationale: Slicing [start:end] includes start index but excludes end
index.
7.
How do you retrieve the value associated with key "name" in a Python
dictionary d?
WGU D278 FINAL EXAM PREP SCRIPTING AND
PROGRAMMING 2026 JUST RELEASED 99% TOP SCORE
FREE DOWNLOAD PDF
Purpose
• Tests ability to write, debug, and analyze scripts in Python, Bash, PowerShell, or
JavaScript.
• Focuses on problem-solving, automation, and algorithmic thinking.
Format
• Multiple-choice, scenario-based coding, and script analysis.
• Questions involve predicting output, finding errors, or suggesting improvements.
Core Topics
1. Programming Basics: Variables, data types, operators, conditionals, loops.
2. Functions & Modular Code: Function definition, arguments, return values, scope.
3. Data Structures: Lists/arrays, dictionaries/maps, sets.
4. File Handling: Reading/writing files, parsing CSV/JSON.
5. Error Handling: Exceptions, debugging techniques.
6. Automation Scripts: Loops, file I/O, system commands.
7. Algorithms: Searching, sorting, string/number manipulation.
8. Basic OOP: Classes, objects, methods, attributes.
9. Best Practices: Readable code, comments, efficiency.
Exam Tips
• Practice predicting script outputs.
• Focus on common errors: loops, syntax, indentation.
• Understand logic and syntax differences across languages.
• Manage time on scenario-based questions.
,2
1.
Which of the following is the correct way to declare a variable in
Python?
A. var x = 10
B. x = 10
C. int x = 10
D. let x := 10
Answer: B
Rationale: Python does not require explicit type declaration; x = 10 is
correct.
2.
What is the output of the following Python code?
x = "5"
y=3
print(x * y)
A. 15
B. 555
C. 53
D. Error
,3
Answer: B
Rationale: Multiplying a string by an integer repeats the string; "5"*3 →
"555".
3.
Which statement correctly checks if a number n is between 10 and 20 in
Python?
A. if 10 < n < 20:
B. if n > 10 and n < 20:
C. Both A and B
D. if n in range(10, 20):
Answer: C
Rationale: Both A and B are valid ways to check the condition.
4.
What is the output of the following code?
for i in range(3):
print(i)
A. 1 2 3
B. 0 1 2
C. 0 1 2 3
D. 1 2
Answer: B
Rationale: range(3) produces 0, 1, 2.
, 4
5.
Which of the following defines a Python function that returns the
square of a number?
A. def square(x): return x*x
B. def square(x) x*x
C. function square(x) {return x*x}
D. def square x: return x*x
Answer: A
Rationale: Correct Python function syntax requires def and proper
colon/return usage.
6.
Given the list lst = [1, 2, 3, 4], what is the result of lst[1:3]?
A. [1, 2]
B. [2, 3]
C. [2, 3, 4]
D. [1, 2, 3]
Answer: B
Rationale: Slicing [start:end] includes start index but excludes end
index.
7.
How do you retrieve the value associated with key "name" in a Python
dictionary d?