WGU E010 OBJECTIVE ASSESSMENT FINAL
ACTUAL EXAM AND PRACTICE QUESTIONS AND
SOLUTIONS
SECTION 1: Python Fundamentals & Syntax (Questions 1-15)
Q1. What is the correct output of print("Hello, World!")?
A) Hello, World!
B) "Hello, World!"
C) print("Hello, World!")
D) An error occurs
Answer: A — The print() function outputs the string literal to the console without the quotation marks.
The quotes are used only to denote the string .
Q2. Which of the following is a valid variable name in Python?
A) 2_variable
B) my-variable
C) _myVariable
D) my variable
Answer: C — Variable names can start with a letter or underscore, cannot start with a digit, and cannot
contain spaces or hyphens .
Q3. What is the data type of the value 3.14 in Python?
A) int
B) float
C) string
D) boolean
Answer: B — Numbers with a decimal point are of type float (floating-point). Integers have no decimal .
Q4. In Python, which symbol is used for single-line comments?
A) //
B) #
C) /*
D) <!--
,Answer: B — The hash character # indicates a single-line comment. Everything after it on the same line
is ignored by the interpreter .
Q5. What is the output of print(type(10/2))?
A) <class 'int'>
B) <class 'float'>
C) <class 'double'>
D) <class 'str'>
Answer: B — In Python, the / operator performs true division and always returns a float, even when the
numbers divide evenly (10/2 = 5.0) .
Q6. Which data type is immutable?
A) list
B) dict
C) set
D) tuple
Answer: D — A tuple cannot be changed after creation (immutable). Lists, dictionaries, and sets are
mutable .
Q7. What will the following code print?
python
x = "Hello"
print(x[1])
A) H
B) e
C) l
D) o
Answer: B — Strings are zero-indexed. Index 0 → 'H', index 1 → 'e' .
Q8. What is the output of print(2 ** 3)?
A) 6
B) 8
C) 9
D) 5
, Answer: B — The ** operator is the exponentiation operator. 2 ** 3 means 2 raised to the power of 3 =
8.
Q9. Given x = 5 and y = 2, what is the result of x // y?
A) 2.5
B) 2
C) 2.0
D) 1
Answer: B — The floor division operator // returns the integer quotient (discards remainder). 5 // 2 = 2 .
Q10. What is the result of 17 % 5 in Python?
A) 3.4
B) 2
C) 3
D) 3.4
Answer: B — The % operator is the modulo operator; it returns the remainder of division (17 ÷ 5 = 3
remainder 2) .
Q11. Which loop is best used when the number of iterations is unknown?
A) for loop
B) while loop
C) nested loop
D) for-each loop
Answer: B — A while loop runs until a condition becomes False, making it ideal when the number of
iterations is not known in advance .
Q12. What does the break statement do in a loop?
A) Skips the current iteration
B) Exits the loop completely
C) Restarts the loop from the beginning
D) Pauses the loop temporarily
Answer: B — break immediately terminates the innermost loop and resumes execution after the loop .
Q13. What is the output of print(5 + 3 * 2)?
A) 16
B) 11
ACTUAL EXAM AND PRACTICE QUESTIONS AND
SOLUTIONS
SECTION 1: Python Fundamentals & Syntax (Questions 1-15)
Q1. What is the correct output of print("Hello, World!")?
A) Hello, World!
B) "Hello, World!"
C) print("Hello, World!")
D) An error occurs
Answer: A — The print() function outputs the string literal to the console without the quotation marks.
The quotes are used only to denote the string .
Q2. Which of the following is a valid variable name in Python?
A) 2_variable
B) my-variable
C) _myVariable
D) my variable
Answer: C — Variable names can start with a letter or underscore, cannot start with a digit, and cannot
contain spaces or hyphens .
Q3. What is the data type of the value 3.14 in Python?
A) int
B) float
C) string
D) boolean
Answer: B — Numbers with a decimal point are of type float (floating-point). Integers have no decimal .
Q4. In Python, which symbol is used for single-line comments?
A) //
B) #
C) /*
D) <!--
,Answer: B — The hash character # indicates a single-line comment. Everything after it on the same line
is ignored by the interpreter .
Q5. What is the output of print(type(10/2))?
A) <class 'int'>
B) <class 'float'>
C) <class 'double'>
D) <class 'str'>
Answer: B — In Python, the / operator performs true division and always returns a float, even when the
numbers divide evenly (10/2 = 5.0) .
Q6. Which data type is immutable?
A) list
B) dict
C) set
D) tuple
Answer: D — A tuple cannot be changed after creation (immutable). Lists, dictionaries, and sets are
mutable .
Q7. What will the following code print?
python
x = "Hello"
print(x[1])
A) H
B) e
C) l
D) o
Answer: B — Strings are zero-indexed. Index 0 → 'H', index 1 → 'e' .
Q8. What is the output of print(2 ** 3)?
A) 6
B) 8
C) 9
D) 5
, Answer: B — The ** operator is the exponentiation operator. 2 ** 3 means 2 raised to the power of 3 =
8.
Q9. Given x = 5 and y = 2, what is the result of x // y?
A) 2.5
B) 2
C) 2.0
D) 1
Answer: B — The floor division operator // returns the integer quotient (discards remainder). 5 // 2 = 2 .
Q10. What is the result of 17 % 5 in Python?
A) 3.4
B) 2
C) 3
D) 3.4
Answer: B — The % operator is the modulo operator; it returns the remainder of division (17 ÷ 5 = 3
remainder 2) .
Q11. Which loop is best used when the number of iterations is unknown?
A) for loop
B) while loop
C) nested loop
D) for-each loop
Answer: B — A while loop runs until a condition becomes False, making it ideal when the number of
iterations is not known in advance .
Q12. What does the break statement do in a loop?
A) Skips the current iteration
B) Exits the loop completely
C) Restarts the loop from the beginning
D) Pauses the loop temporarily
Answer: B — break immediately terminates the innermost loop and resumes execution after the loop .
Q13. What is the output of print(5 + 3 * 2)?
A) 16
B) 11