WGU D335 Intro to Python | OA | Objective
Assessment | 30 Actual Questions and
Answers | 2026 Update | 100% Correct.
Course
D335
1. What is the output?
x=8
y=3
print(x // y)
A. 2.666
B. 2
C. 3
D. 5
Answer: B. 2
Rationale: // performs floor division. 8 // 3 produces 2.
2. Which statement correctly gets an integer from the user?
A. age = input(int())
B. age = integer(input())
C. age = int(input())
D. age = input(integer())
Answer: C. age = int(input())
Rationale: input() returns a string. Wrapping it with int() converts the entered value to an
integer.
3. What is printed?
name = "Python"
print(name[1:4])
, A. Pyt
B. yth
C. tho
D. Python
Answer: B. yth
Rationale: Slicing starts at index 1 and stops before index 4. The characters at indexes 1, 2, and
3 are y, t, and h.
4. Which is a valid Python variable name?
A. student-name
B. 2student
C. student_name
D. student name
Answer: C. student_name
Rationale: Python identifiers can contain letters, digits, and underscores but cannot begin with
a digit or contain spaces/hyphens.
5. What is the output?
x = 10
if x > 5:
print("A")
else:
print("B")
A. A
B. B
C. AB
D. Nothing
Answer: A. A
Rationale: 10 > 5 evaluates to True, so the first branch executes.
Assessment | 30 Actual Questions and
Answers | 2026 Update | 100% Correct.
Course
D335
1. What is the output?
x=8
y=3
print(x // y)
A. 2.666
B. 2
C. 3
D. 5
Answer: B. 2
Rationale: // performs floor division. 8 // 3 produces 2.
2. Which statement correctly gets an integer from the user?
A. age = input(int())
B. age = integer(input())
C. age = int(input())
D. age = input(integer())
Answer: C. age = int(input())
Rationale: input() returns a string. Wrapping it with int() converts the entered value to an
integer.
3. What is printed?
name = "Python"
print(name[1:4])
, A. Pyt
B. yth
C. tho
D. Python
Answer: B. yth
Rationale: Slicing starts at index 1 and stops before index 4. The characters at indexes 1, 2, and
3 are y, t, and h.
4. Which is a valid Python variable name?
A. student-name
B. 2student
C. student_name
D. student name
Answer: C. student_name
Rationale: Python identifiers can contain letters, digits, and underscores but cannot begin with
a digit or contain spaces/hyphens.
5. What is the output?
x = 10
if x > 5:
print("A")
else:
print("B")
A. A
B. B
C. AB
D. Nothing
Answer: A. A
Rationale: 10 > 5 evaluates to True, so the first branch executes.