WGU D278 SCRIPTING |OA|
OBJECTIVE ASSESSMENT| EXAM
QUESTIONS AND CORRECT
ANSWERS|| LATEST UPDATE 2026
1. Which data type stores whole numbers in Python?
A. float
B. string
C. int
D. boolean
✅ Answer: C
Rationale: int represents whole numbers.
2. What is the output of this code?
x = 10
print(type(x))
A. <class 'float'>
B. <class 'string'>
C. <class 'int'>
D. <class 'number'>
✅ Answer: C
Rationale: 10 is an integer.
3. Which symbol is used for assignment in Python?
A. ==
B. :=
C. =
D. ===
,✅ Answer: C
Rationale: = assigns a value.
4. Which variable name is valid?
A. 2total
B. total_amount
C. total-amount
D. class
✅ Answer: B
Rationale: Variable names cannot start with numbers or use hyphens.
5. What does this evaluate to?
5 + 2 * 3
A. 21
B. 11
C. 17
D. 10
✅ Answer: B
Rationale: Multiplication happens before addition.
🔹 SECTION 2: STRINGS
6. What is the output?
print("Hello"[1])
A. H
B. e
C. l
D. o
✅ Answer: B
Rationale: Indexing starts at 0.
, 7. Which function returns the length of a string?
A. count()
B. size()
C. length()
D. len()
✅ Answer: D
Rationale: len() returns length.
8. What does this output?
print("Hi" * 3)
A. Hi3
B. Hi Hi Hi
C. HiHiHi
D. Error
✅ Answer: C
Rationale: Strings can be multiplied.
9. How do you convert a number to a string?
A. string()
B. toString()
C. str()
D. convert()
✅ Answer: C
10. Which method converts text to lowercase?
A. lower()
B. down()
C. small()
D. casefolded()
OBJECTIVE ASSESSMENT| EXAM
QUESTIONS AND CORRECT
ANSWERS|| LATEST UPDATE 2026
1. Which data type stores whole numbers in Python?
A. float
B. string
C. int
D. boolean
✅ Answer: C
Rationale: int represents whole numbers.
2. What is the output of this code?
x = 10
print(type(x))
A. <class 'float'>
B. <class 'string'>
C. <class 'int'>
D. <class 'number'>
✅ Answer: C
Rationale: 10 is an integer.
3. Which symbol is used for assignment in Python?
A. ==
B. :=
C. =
D. ===
,✅ Answer: C
Rationale: = assigns a value.
4. Which variable name is valid?
A. 2total
B. total_amount
C. total-amount
D. class
✅ Answer: B
Rationale: Variable names cannot start with numbers or use hyphens.
5. What does this evaluate to?
5 + 2 * 3
A. 21
B. 11
C. 17
D. 10
✅ Answer: B
Rationale: Multiplication happens before addition.
🔹 SECTION 2: STRINGS
6. What is the output?
print("Hello"[1])
A. H
B. e
C. l
D. o
✅ Answer: B
Rationale: Indexing starts at 0.
, 7. Which function returns the length of a string?
A. count()
B. size()
C. length()
D. len()
✅ Answer: D
Rationale: len() returns length.
8. What does this output?
print("Hi" * 3)
A. Hi3
B. Hi Hi Hi
C. HiHiHi
D. Error
✅ Answer: C
Rationale: Strings can be multiplied.
9. How do you convert a number to a string?
A. string()
B. toString()
C. str()
D. convert()
✅ Answer: C
10. Which method converts text to lowercase?
A. lower()
B. down()
C. small()
D. casefolded()