Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

WGU D278 – Scripting and Programming Foundations Full Actual Exam | Updated 2025 Edition

Rating
-
Sold
-
Pages
39
Grade
A+
Uploaded on
13-11-2025
Written in
2025/2026

WGU D278 – Scripting and Programming Foundations Full Actual Exam | Updated 2025 Edition

Content preview

WGU D278 – Scripting and Programming
Foundations Full Actual Exam | Updated 2025
Edition

Exam Overview

This complete practice exam has been carefully designed to reflect the structure, style, and
content focus of the official WGU D278: Scripting and Programming – Foundations
assessment.
It includes:

Topics Covered

✅ Python syntax and variables
✅ Data types and operators
✅ Conditional logic and loops
✅ Functions, scope, and parameters
✅ Lists, tuples, dictionaries, and sets
✅ Input/output operations
✅ Exception handling
✅ File processing
✅ Object-oriented programming concepts
✅ Algorithmic logic and pseudocode




1. What is the output of the following code?
x = 5
y = 10
print(x + y)

A) 15
B) 15
C) 510
D) Error

✅ Rationale: Addition between integers returns their sum, 15.

,2. Which of the following is a valid variable name in Python?

A) 2ndName
B) my-name
C) my_name
D) class

✅ Rationale: Variables cannot start with a digit or use hyphens. class is a reserved keyword.



3. What is the output?
x = "5"
y = 2
print(x * y)

A) 10
B) Error
C) 55
D) '10'

✅ Rationale: String multiplied by integer repeats the string — "5" * 2 = "55".



4. Which data type is immutable in Python?

A) List
B) Dictionary
C) Tuple
D) Set

✅ Rationale: Tuples cannot be changed after creation.



5. What is the correct output?
for i in range(3):
print(i)

A) 1 2 3
B) 0 1 2

,C) 0 1 2 3
D) 3

✅ Rationale: range(3) generates 0, 1, 2.



6. Which keyword defines a function in Python?

A) func
B) def
C) define
D) function

✅ Rationale: def is the keyword used to declare a function.



7. What is printed by this code?
def greet(name="Student"):
print("Hello", name)

greet()

A) Error
B) Hello
C) Hello Student
D) Hello None

✅ Rationale: Default argument is used when no argument is passed.



8. What is the output?
nums = [2, 4, 6]
nums.append(8)
print(nums)

A) [2, 4, 6]
B) [2, 4, 6, 8]
C) [8, 6, 4, 2]
D) [2, 4, 6][8]

✅ Rationale: .append() adds an element to the end of a list.

, 9. What is the result of bool("")?

A) True
B) False
C) None
D) Error

✅ Rationale: Empty strings evaluate to False in Boolean context.



10. Which symbol is used for integer division in Python?

A) /
B) //
C) %
D) **

✅ Rationale: // returns integer (floor) division results.




11. What is the output of the following code?
x = 3
if x > 2:
print("High")
else:
print("Low")

A) High
B) Low
C) 2
D) Error

✅ Rationale: The condition x > 2 is true, so it prints “High”.



12. Which of these statements will create a list?

A) list = (1, 2, 3)
B) list = [1, 2, 3]

Document information

Uploaded on
November 13, 2025
Number of pages
39
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$70.50
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Casewritters Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
138
Member since
10 months
Number of followers
6
Documents
1668
Last sold
2 days ago

3.9

27 reviews

5
15
4
3
3
4
2
2
1
3

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions