WGU C173 Scripting and Programming
Foundations Exam 2026/2027 – Verified
Q&As with Detailed Rationales (Test
Bank Bundle - 47 Questions)
---
*QUESTION 1:*
A programmer needs to store a value that represents whether a user is logged in. Which data type is
most appropriate?
A) Boolean
B) Integer
C) String
D) Float
> 🎯 *CORRECT ANSWER:* A) Boolean
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* Boolean is for true/false values.
> * *Why Distractors Fail:* Integer, string, and float are for other types.
> * *Core Takeaway:* Use Boolean for true/false.
---
*QUESTION 2:*
What is the result of `10 % 3` in Python?
A) 1
,B) 3
C) 0
D) 10
> 🎯 *CORRECT ANSWER:* A) 1
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* `%` is the modulus operator; 10 divided by 3 has a remainder of 1.
> * *Why Distractors Fail:* 3 is the quotient; 0 and 10 are incorrect.
> * *Core Takeaway:* `%` returns the remainder.
---
*QUESTION 3:*
A programmer writes `x = "5" + "6"`. What is the value of x?
A) "56"
B) 11
C) "11"
D) Error
> 🎯 *CORRECT ANSWER:* A) "56"
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* The `+` operator concatenates strings.
> * *Why Distractors Fail:* 11 would be numeric addition; "11" is not correct.
> * *Core Takeaway:* `+` concatenates strings.
---
*QUESTION 4:*
Which of the following is a valid variable name in Python?
, A) my_name
B) 1st_name
C) my-name
D) my name
> 🎯 *CORRECT ANSWER:* A) my_name
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* Underscore is allowed; cannot start with a number; no spaces or hyphens.
> * *Why Distractors Fail:* Starting with a number, hyphens, and spaces are invalid.
> * *Core Takeaway:* Variables can use underscores and letters.
---
*QUESTION 5:*
A programmer wants to check if a number is greater than 10 and less than 20. Which condition is
correct?
A) if x > 10 and x < 20
B) if x > 10 or x < 20
C) if x > 10 & x < 20
D) if x > 10 && x < 20
> 🎯 *CORRECT ANSWER:* A) if x > 10 and x < 20
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* `and` requires both conditions to be true.
> * *Why Distractors Fail:* `or` requires only one; `&` and `&&` are not used in Python.
> * *Core Takeaway:* Use `and` for multiple conditions.
---
*QUESTION 6:*
Foundations Exam 2026/2027 – Verified
Q&As with Detailed Rationales (Test
Bank Bundle - 47 Questions)
---
*QUESTION 1:*
A programmer needs to store a value that represents whether a user is logged in. Which data type is
most appropriate?
A) Boolean
B) Integer
C) String
D) Float
> 🎯 *CORRECT ANSWER:* A) Boolean
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* Boolean is for true/false values.
> * *Why Distractors Fail:* Integer, string, and float are for other types.
> * *Core Takeaway:* Use Boolean for true/false.
---
*QUESTION 2:*
What is the result of `10 % 3` in Python?
A) 1
,B) 3
C) 0
D) 10
> 🎯 *CORRECT ANSWER:* A) 1
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* `%` is the modulus operator; 10 divided by 3 has a remainder of 1.
> * *Why Distractors Fail:* 3 is the quotient; 0 and 10 are incorrect.
> * *Core Takeaway:* `%` returns the remainder.
---
*QUESTION 3:*
A programmer writes `x = "5" + "6"`. What is the value of x?
A) "56"
B) 11
C) "11"
D) Error
> 🎯 *CORRECT ANSWER:* A) "56"
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* The `+` operator concatenates strings.
> * *Why Distractors Fail:* 11 would be numeric addition; "11" is not correct.
> * *Core Takeaway:* `+` concatenates strings.
---
*QUESTION 4:*
Which of the following is a valid variable name in Python?
, A) my_name
B) 1st_name
C) my-name
D) my name
> 🎯 *CORRECT ANSWER:* A) my_name
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* Underscore is allowed; cannot start with a number; no spaces or hyphens.
> * *Why Distractors Fail:* Starting with a number, hyphens, and spaces are invalid.
> * *Core Takeaway:* Variables can use underscores and letters.
---
*QUESTION 5:*
A programmer wants to check if a number is greater than 10 and less than 20. Which condition is
correct?
A) if x > 10 and x < 20
B) if x > 10 or x < 20
C) if x > 10 & x < 20
D) if x > 10 && x < 20
> 🎯 *CORRECT ANSWER:* A) if x > 10 and x < 20
> 💡 *CLINICAL RATIONALE:*
> * *Why It's Right:* `and` requires both conditions to be true.
> * *Why Distractors Fail:* `or` requires only one; `&` and `&&` are not used in Python.
> * *Core Takeaway:* Use `and` for multiple conditions.
---
*QUESTION 6:*