WGU E010 OBJECTIVE ASSESSMENT FINAL ACTUAL EXAM AND
PRACTICE QUESTIONS AND SOLUTIONS
Section 1: Basic Syntax, Variables & Data Types (Q1-20)
Q1. What is the correct way to output the string "Hello, World!" in Python?
A) printf("Hello, World!")
B) console.log("Hello, World!")
C) print("Hello, World!")
D) echo "Hello, World!"
Answer: C
Rationale: In Python, the built-in print() function outputs text to the console. printf() is used in
C, console.log() in JavaScript, and echo in PHP/shell .
Q2. Which of the following is a valid variable name in Python?
A) 2nd_place
B) my_var
C) my-var
D) class
Answer: B
Rationale: Variable names must start with a letter or underscore, cannot contain hyphens, and cannot
be a reserved keyword (class is a keyword). 2nd_place starts with a number, my-var contains a hyphen,
and class is a reserved word .
Q3. What is the data type of the value 3.14 in Python?
A) int
B) float
C) string
D) boolean
Answer: B
Rationale: Numbers with a decimal point are of type float (floating-point). Integers have no decimal
point .
Q4. 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
Rationale: The floor division operator // returns the integer quotient (discards the remainder). 5 // 2 =
2.
Q5. What is the result of bool([]) in Python?
A) True
B) False
C) None
D) Error
Answer: B
Rationale: Empty containers (lists, dicts, sets, tuples, strings) evaluate to False in a boolean context.
Non-empty containers are True .
Q6. Which operator is used to check if two values are equal in Python?
A) =
B) ==
C) !=
D) ===
Answer: B
Rationale: == is the equality comparison operator. = is assignment. != means not equal. === is not valid
in Python .
Q7. What is the output of print(10 % 3)?
A) 3.33
B) 1
C) 1.0
D) 3
Answer: B
Rationale: The modulo operator % returns the remainder of division. 10 ÷ 3 = 3 remainder 1 .
Q8. What is the output of print(type(10))?
A) <class 'int'>
B) <class 'float'>
C) <class 'str'>
D) <class 'bool'>
, Answer: A
Rationale: 10 is a whole number without a decimal point, so it is of type int (integer) .
Q9. Which of the following correctly converts the string "123" to an integer?
A) int("123")
B) str("123")
C) float("123")
D) convert("123")
Answer: A
Rationale: int() converts a string (or float) to an integer. str() converts to string, float() to floating-point .
Q10. What is the output of print(15 % 4)?
A) 3
B) 4
C) 2
D) 3.75
Answer: A
Rationale: 15 divided by 4 leaves a remainder of 3 .
Q11. Which data type is unordered and does NOT allow duplicates?
A) list
B) tuple
C) set
D) dict
Answer: C
Rationale: Sets automatically remove duplicate values and are unordered. Lists and tuples maintain
order; dictionaries store key-value pairs .
Q12. What does len([]) return?
A) 0
B) 1
C) None
D) Error
Answer: A
Rationale: An empty list has length 0 .
PRACTICE QUESTIONS AND SOLUTIONS
Section 1: Basic Syntax, Variables & Data Types (Q1-20)
Q1. What is the correct way to output the string "Hello, World!" in Python?
A) printf("Hello, World!")
B) console.log("Hello, World!")
C) print("Hello, World!")
D) echo "Hello, World!"
Answer: C
Rationale: In Python, the built-in print() function outputs text to the console. printf() is used in
C, console.log() in JavaScript, and echo in PHP/shell .
Q2. Which of the following is a valid variable name in Python?
A) 2nd_place
B) my_var
C) my-var
D) class
Answer: B
Rationale: Variable names must start with a letter or underscore, cannot contain hyphens, and cannot
be a reserved keyword (class is a keyword). 2nd_place starts with a number, my-var contains a hyphen,
and class is a reserved word .
Q3. What is the data type of the value 3.14 in Python?
A) int
B) float
C) string
D) boolean
Answer: B
Rationale: Numbers with a decimal point are of type float (floating-point). Integers have no decimal
point .
Q4. 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
Rationale: The floor division operator // returns the integer quotient (discards the remainder). 5 // 2 =
2.
Q5. What is the result of bool([]) in Python?
A) True
B) False
C) None
D) Error
Answer: B
Rationale: Empty containers (lists, dicts, sets, tuples, strings) evaluate to False in a boolean context.
Non-empty containers are True .
Q6. Which operator is used to check if two values are equal in Python?
A) =
B) ==
C) !=
D) ===
Answer: B
Rationale: == is the equality comparison operator. = is assignment. != means not equal. === is not valid
in Python .
Q7. What is the output of print(10 % 3)?
A) 3.33
B) 1
C) 1.0
D) 3
Answer: B
Rationale: The modulo operator % returns the remainder of division. 10 ÷ 3 = 3 remainder 1 .
Q8. What is the output of print(type(10))?
A) <class 'int'>
B) <class 'float'>
C) <class 'str'>
D) <class 'bool'>
, Answer: A
Rationale: 10 is a whole number without a decimal point, so it is of type int (integer) .
Q9. Which of the following correctly converts the string "123" to an integer?
A) int("123")
B) str("123")
C) float("123")
D) convert("123")
Answer: A
Rationale: int() converts a string (or float) to an integer. str() converts to string, float() to floating-point .
Q10. What is the output of print(15 % 4)?
A) 3
B) 4
C) 2
D) 3.75
Answer: A
Rationale: 15 divided by 4 leaves a remainder of 3 .
Q11. Which data type is unordered and does NOT allow duplicates?
A) list
B) tuple
C) set
D) dict
Answer: C
Rationale: Sets automatically remove duplicate values and are unordered. Lists and tuples maintain
order; dictionaries store key-value pairs .
Q12. What does len([]) return?
A) 0
B) 1
C) None
D) Error
Answer: A
Rationale: An empty list has length 0 .