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 Exam 2026/2027 – Verified Q&As with Detailed Rationales (Test Bank Bundle - 74 Questions)

Rating
-
Sold
-
Pages
40
Grade
A+
Uploaded on
08-07-2026
Written in
2025/2026

WGU D278 Scripting and Programming Foundations Exam 2026/2027 – Verified Q&As with Detailed Rationales (Test Bank Bundle - 74 Questions)

Institution
WGU D278 Scripting And Programming Founda
Course
WGU D278 Scripting and Programming Founda

Content preview

WGU D278 Scripting and Programming
Foundations Exam 2026/2027 – Verified
Q&As with Detailed Rationales (Test
Bank Bundle - 74 Questions)



*QUESTION 1:*

What is the primary purpose of a variable in programming?

A) To store a value for later use and manipulation

B) To display output to the user

C) To control the flow of execution

D) To repeat a block of code

> 🎯 *CORRECT ANSWER:* A) To store a value for later use and manipulation

> 💡 *CLINICAL RATIONALE:*

> * *Why It's Right:* Variables are fundamental for data storage.

> * *Why Distractors Fail:* Output, flow control, and repetition are separate functions.

> * *Core Takeaway:* Variables hold data.



---

*QUESTION 2:*

Which data type is best suited for storing a person's age?

,A) String

B) Integer

C) Float

D) Boolean

> 🎯 *CORRECT ANSWER:* B) Integer

> 💡 *CLINICAL RATIONALE:*

> * *Why It's Right:* Age is a whole number without decimal points.

> * *Why Distractors Fail:* String is for text; float is for decimals; boolean is true/false.

> * *Core Takeaway:* Use integers for whole numbers.



---

*QUESTION 3:*

What is the correct syntax for declaring a constant in Python?

A) const PI = 3.14159

B) final double PI = 3.14159

C) PI = 3.14159 (by convention, uppercase indicates constant)

D) #define PI 3.14159

> 🎯 *CORRECT ANSWER:* C) PI = 3.14159 (by convention, uppercase indicates constant)

> 💡 *CLINICAL RATIONALE:*

> * *Why It's Right:* Python uses naming conventions rather than explicit constants.

> * *Why Distractors Fail:* The other options are for different languages.

> * *Core Takeaway:* Python constants are a naming convention.



---

*QUESTION 4:*

,A programmer needs to execute a block of code if a condition is true, and another block if it is false.
Which control structure should be used?

A) If-Else

B) For loop

C) While loop

D) Switch statement

> 🎯 *CORRECT ANSWER:* A) If-Else

> 💡 *CLINICAL RATIONALE:*

> * *Why It's Right:* If-else provides a two-way branch based on a condition.

> * *Why Distractors Fail:* Loops are for repetition; switch is for multiple comparisons.

> * *Core Takeaway:* If-else handles true/false branching.



---

*QUESTION 5:*

What will the following Python code output: print("Hello" + " World")

A) Hello World

B) HelloWorld

C) Hello + World

D) Error

> 🎯 *CORRECT ANSWER:* A) Hello World

> 💡 *CLINICAL RATIONALE:*

> * *Why It's Right:* The plus operator concatenates strings with a space.

> * *Why Distractors Fail:* HelloWorld would occur without the space; + is not printed.

> * *Core Takeaway:* String concatenation joins strings.



---

, *QUESTION 6:*

Which operator is used to compare two values for equality in most programming languages?

A) =

B) ==

C) !=

D) <=

> 🎯 *CORRECT ANSWER:* B) ==

> 💡 *CLINICAL RATIONALE:*

> * *Why It's Right:* == is the equality comparison operator.

> * *Why Distractors Fail:* = is assignment; != is inequality; <= is less than or equal.

> * *Core Takeaway:* Use == to test equality.



---

*QUESTION 7:*

What is the result of the expression 5 // 2 in Python?

A) 2

B) 2.5

C) 2.0

D) 3

> 🎯 *CORRECT ANSWER:* A) 2

> 💡 *CLINICAL RATIONALE:*

> * *Why It's Right:* // is floor division, returning the integer quotient.

> * *Why Distractors Fail:* 2.5 is true division; 3 is rounding up.

> * *Core Takeaway:* Floor division discards the remainder.

Written for

Institution
WGU D278 Scripting and Programming Founda
Course
WGU D278 Scripting and Programming Founda

Document information

Uploaded on
July 8, 2026
Number of pages
40
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$50.99
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
andrewmwas167

Get to know the seller

Seller avatar
andrewmwas167 Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
3
Member since
2 weeks
Number of followers
0
Documents
318
Last sold
1 day ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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