WGU D335 – Intro to Python Objective Assessment | OA | Questions
and Answers | 2026 Update | 100% Correct.
🧪 WGU D335 – Intro to Python
FULL 60-Question Timed Mock OA
SECTION 1: Python Basics (Q1–Q10)
1. Which statement correctly prints text in Python?
A. echo "Hello"
B. print["Hello"]
C. print("Hello")
D. console.log("Hello")
2. Which of the following is a valid variable name?
A. total-cost
B. 2total
C. _totalCost
D. total cost
3. What is the data type of the value returned by input()?
A. int
B. float
C. str
D. bool
4. What is the output?
print(type(5))
A. <class 'float'>
B. <class 'int'>
C. <class 'str'>
D. <class 'number'>
5. Which operator performs exponentiation?
A. ^
B. *
,C. **
D. //
6. What is the output?
x=7
y=2
print(x % y)
A. 3
B. 2
C. 1
D. 0
7. Which keyword converts a value to an integer?
A. int()
B. str()
C. float()
D. bool()
8. What will this code output?
print("5" + "3")
A. 8
B. 53
C. Error
D. 5 3
9. Which symbol is used for comments in Python?
A. //
B. /* */
C. #
D. --
10. Which statement assigns multiple variables correctly?
A. a = b = c 10
B. a, b, c = 1, 2, 3
,C. a <- 1
D. int a = 5
SECTION 2: Conditionals & Loops (Q11–Q20)
11. Which operator checks equality?
A. =
B. !=
C. ==
D. <=
12. What is the output?
x=4
if x > 5:
print("A")
else:
print("B")
13. Which loop executes at least once?
A. for
B. while
C. do-while
D. Python has none
14. What does continue do?
A. Stops the loop
B. Skips current iteration
C. Restarts program
D. Ends function
15. What is the output?
for i in range(3):
print(i)
A. 1 2 3
B. 0 1 2
, C. 0 1 2 3
D. Error
16. Which statement creates an infinite loop?
A. while True:
B. for i in range(0):
C. if True:
D. while False:
17. What keyword exits a loop immediately?
A. stop
B. exit
C. break
D. end
18. What is the output?
x = 10
while x > 7:
x -= 1
print(x)
A. 7
B. 8
C. 9
D. 10
19. Which conditional checks multiple conditions?
A. if else
B. if elif else
C. switch
D. case
20. Which value evaluates to False?
A. 1
B. "False"
C. []
D. "0"
and Answers | 2026 Update | 100% Correct.
🧪 WGU D335 – Intro to Python
FULL 60-Question Timed Mock OA
SECTION 1: Python Basics (Q1–Q10)
1. Which statement correctly prints text in Python?
A. echo "Hello"
B. print["Hello"]
C. print("Hello")
D. console.log("Hello")
2. Which of the following is a valid variable name?
A. total-cost
B. 2total
C. _totalCost
D. total cost
3. What is the data type of the value returned by input()?
A. int
B. float
C. str
D. bool
4. What is the output?
print(type(5))
A. <class 'float'>
B. <class 'int'>
C. <class 'str'>
D. <class 'number'>
5. Which operator performs exponentiation?
A. ^
B. *
,C. **
D. //
6. What is the output?
x=7
y=2
print(x % y)
A. 3
B. 2
C. 1
D. 0
7. Which keyword converts a value to an integer?
A. int()
B. str()
C. float()
D. bool()
8. What will this code output?
print("5" + "3")
A. 8
B. 53
C. Error
D. 5 3
9. Which symbol is used for comments in Python?
A. //
B. /* */
C. #
D. --
10. Which statement assigns multiple variables correctly?
A. a = b = c 10
B. a, b, c = 1, 2, 3
,C. a <- 1
D. int a = 5
SECTION 2: Conditionals & Loops (Q11–Q20)
11. Which operator checks equality?
A. =
B. !=
C. ==
D. <=
12. What is the output?
x=4
if x > 5:
print("A")
else:
print("B")
13. Which loop executes at least once?
A. for
B. while
C. do-while
D. Python has none
14. What does continue do?
A. Stops the loop
B. Skips current iteration
C. Restarts program
D. Ends function
15. What is the output?
for i in range(3):
print(i)
A. 1 2 3
B. 0 1 2
, C. 0 1 2 3
D. Error
16. Which statement creates an infinite loop?
A. while True:
B. for i in range(0):
C. if True:
D. while False:
17. What keyword exits a loop immediately?
A. stop
B. exit
C. break
D. end
18. What is the output?
x = 10
while x > 7:
x -= 1
print(x)
A. 7
B. 8
C. 9
D. 10
19. Which conditional checks multiple conditions?
A. if else
B. if elif else
C. switch
D. case
20. Which value evaluates to False?
A. 1
B. "False"
C. []
D. "0"