WGU D278 Final Exam Actual Exam
2026/2027 | Scripting and
Programming - Foundations | WGU |
Questions with Verified Answers |
100% Correct | Pass Guaranteed
Q001: A script declares x = 7 and then runs if x % 2 == 0: print("even"). What will
be printed?
Options:
A. even
B. odd
C. nothing
D. error
ANSWER: C
Q002: Which data type is returned by the Python expression type(3.14)?
Options:
A. int
B. float
C. str
D. bool
ANSWER: B
Q003: What is the final value of z after running z = 5; z += 3?
, 2
Options:
A. 3
B. 5
C. 8
D. 15
ANSWER: C
Q004: The pseudocode for i from 1 to 4 print i will output:
Options:
A. 0 1 2 3
B. 1 2 3 4
C. 1 2 3
D. 4 3 2 1
ANSWER: B
Q005: Which keyword is used to define a function in Python?
Options:
A. func
B. define
C. def
D. function
ANSWER: C
Q006: What is returned by len("hello")?
Options:
A. 4
B. 5
, 3
C. 6
D. error
ANSWER: B
Q007: Given lst = [2, 4, 6], what is the result of lst[1]?
Options:
A. 2
B. 4
C. 6
D. 0
ANSWER: B
Q008: The expression 3 * "ab" produces:
Options:
A. "ababab"
B. "ab ab ab"
C. 6
D. "ab"
ANSWER: A
Q009: Which operator has higher precedence in most languages: + or *?
Options:
A. +
B. *
C. same
D. depends on context
ANSWER: B