WGU D335 Exam 2026/2027 Actual Exam | 100%
Correct Answers | Complete Resource with
Verified Solutions | Updated for Current WGU
Information Technology Standards | Pass
Guaranteed - A+ Graded
Section 1: Programming Fundamentals & Python Basics (Questions 1-20)
Q1: In Python, which of the following is a valid variable name?
A. 2nd_value
B. my-variable
C. my_variable [CORRECT]
D. my variable
Correct Answer: C
Rationale: Python variable names must start with a letter or underscore, contain only letters,
numbers, and underscores, and cannot contain spaces or hyphens; "my_variable" follows all
naming conventions.
Q2: What data type is the result of the expression in Python 3?
A. int
B. float [CORRECT]
C. string
D. boolean
Correct Answer: B
Rationale: In Python 3, the division operator (/) always returns a float result, even when dividing
two integers; returns 2.5 as a float, unlike floor division (//) which returns an integer.
Q3: Which function is used to get user input from the keyboard in Python?
A. get()
B. input() [CORRECT]
C. read()
1
,2
D. scan()
Correct Answer: B
Rationale: The built-in input() function reads a line from standard input, converts it to a string
(stripping the trailing newline), and returns that string; the result is always of type str and may
need conversion for numeric use.
Q4: What is the output of print(10 % 3)?
A. 3.33
B. 1 [CORRECT]
C. 3
D. 0
Correct Answer: B
Rationale: The modulo operator (%) returns the remainder of division; 10 divided by 3 equals 3
with a remainder of 1, so 10 % 3 evaluates to 1.
Q5: Which operator is used for exponentiation in Python?
A. ^
B. ** [CORRECT]
C. *
D. //
Correct Answer: B
Rationale: The double asterisk (**) is the exponentiation operator in Python; 2 ** 3 evaluates to
8 (2 cubed), while ^ is the bitwise XOR operator, not exponentiation.
Q6: What is the result of type(3.14) in Python?
A. <class 'int'>
B. <class 'float'> [CORRECT]
C. <class 'str'>
D. <class 'double'>
Correct Answer: B
Rationale: The type() function returns the data type of an object; 3.14 is a floating-point number,
so type(3.14) returns <class 'float'>; Python does not have a separate 'double' type.
2
,3
Q7: Which of the following correctly converts the string "42" to an integer?
A. str("42")
B. int("42") [CORRECT]
C. float("42")
D. convert("42")
Correct Answer: B
Rationale: The int() function converts a string or number to an integer; int("42") returns the
integer 42, while str() would create a string, float() would create 42.0, and convert() is not a
built-in function.
Q8: What is the value of the expression 5 + 3 * 2 in Python?
A. 16
B. 11 [CORRECT]
C. 13
D. 10
Correct Answer: B
Rationale: Python follows operator precedence (PEMDAS/BODMAS); multiplication has higher
precedence than addition, so 3 * 2 is evaluated first (6), then 5 + 6 equals 11.
Q9: Which symbol is used for single-line comments in Python?
A. //
B. /* /
C. # [CORRECT]
D. --
Correct Answer: C
Rationale: The hash symbol (#) indicates a single-line comment in Python; everything after # on
that line is ignored by the interpreter; Python does not use // or / */ as in C-style languages.
Q10: What is the output of print("Hello" + " " + "World")?
A. HelloWorld
B. Hello World [CORRECT]
3
, 4
C. Hello+World
D. Error
Correct Answer: B
Rationale: The + operator concatenates strings in Python; "Hello" + " " + "World" combines the
three strings into "Hello World" with a space between the words.
Q11: Which function converts a number to a string in Python?
A. int()
B. float()
C. str() [CORRECT]
D. char()
Correct Answer: C
Rationale: The str() function converts an object to its string representation; str(42) returns "42",
str(3.14) returns "3.14", enabling concatenation with other strings.
Q12: What is the boolean value of the expression 5 == 5?
A. False
B. True [CORRECT]
C. 5
D. None
Correct Answer: B
Rationale: The comparison operator == tests for equality; since 5 equals 5, the expression
evaluates to the boolean value True, not the integer 5 or None.
Q13: Which escape sequence represents a newline in Python strings?
A. \t
B. \n [CORRECT]
C. \r
D. \
Correct Answer: B
4