PROGRAMMING (PYTHON) OA 2026 | 200
PRACTICE QUESTIONS & VERIFIED
ANSWERS | COMPLETE STUDY GUIDE
WGU E010 FOUNDATIONS OF PROGRAMMING (PYTHON) OA 2026 | 200
PRACTICE QUESTIONS & VERIFIED ANSWERS | COMPLETE STUDY GUIDE
DOCUMENT OVERVIEW:
• This comprehensive study guide contains 200 practice questions designed to
prepare you for the WGU E010 OA exam, covering all major programming concepts
in Python from basic syntax to object-oriented principles.
• Use this material by studying one section at a time, working through questions
systematically, and reviewing rationales carefully to understand not just the correct
answer but the underlying concepts.
SECTION 1: PYTHON BASICS & DATA TYPES (QUESTIONS 1-25)
1. What is the correct way to assign a value to a variable in Python?
A) variable = 10
B) 10 = variable
C) variable := 10
D) 10 -> variable
E) set variable to 10
A) variable = 10
RATIONALE: Python uses the single equals sign (=) for variable assignment. The left
side must be the variable name and the right side must be the value. Option B is
incorrect because you cannot assign to a literal value. Option C uses the walrus
operator (:=) which is for assignment expressions in specific contexts. Option D is
not valid Python syntax. Option E is not valid syntax.
,2. Which of the following is NOT a valid variable name in Python?
A) my_variable
B) _private
C) 2fast
D) myVariable
E) MyClass
C) 2fast
RATIONALE: Variable names in Python cannot begin with a number. They must start
with a letter or underscore. All other options follow valid naming conventions.
Option A uses underscores (valid). Option B starts with an underscore (valid).
Option D uses camelCase (valid). Option E uses PascalCase (valid).
3. What data type would the expression return in Python 3?
A) int
B) float
C) string
D) complex
E) Decimal
B) float
RATIONALE: In Python 3, the division operator (/) always returns a float, even if both
operands are integers. The result of would be 3.3333... (a float). To get integer
division (floor division), you would use the // operator, which would return 3.
4. Which of the following correctly represents a string in Python?
A) string = <Hello World>
,B) string = "Hello World"
C) string = [Hello World]
D) string = {Hello World}
E) string = 'Hello World'
B) string = "Hello World" and E) string = 'Hello World'
RATIONALE: Both double quotes and single quotes can be used to define strings in
Python. The question asks which is correct, and both B and E are valid. However, if
only one answer is expected, both are correct representations. Angle brackets (A),
square brackets (C), and curly braces (D) do not define strings; brackets define lists,
curly braces define sets or dictionaries.
5. What is the output of print(type(3.14))?
A) <class 'integer'>
B) <class 'float'>
C) <class 'number'>
D) <class 'decimal'>
E) float
B) <class 'float'>
RATIONALE: The type() function returns the data type of an object. For the value
3.14, type() returns <class 'float'> because it's a floating-point number. Option A
would be for integers. Option C is not a valid class name. Option D is incorrect;
Decimal is a separate type. Option E is incomplete.
6. Which statement is true about Python lists?
A) Lists are immutable
B) Lists are ordered and can contain different data types
, C) Lists cannot be modified after creation
D) Lists use curly braces
E) Lists do not support indexing
B) Lists are ordered and can contain different data types
RATIONALE: Lists in Python are mutable (can be changed), ordered (maintain
insertion order), and heterogeneous (can contain mixed data types). Option A is
incorrect; lists are mutable. Option C is wrong; lists can be modified. Option D is
wrong; lists use square brackets []. Option E is wrong; lists support indexing.
7. What will be the output of len("Python")?
A) 5
B) 6
C) 7
D) 8
E) Error
B) 6
RATIONALE: The len() function returns the number of characters in a string.
"Python" has 6 characters: P-y-t-h-o-n. Each character, including lowercase letters, is
counted.
8. How do you create a tuple with a single element?
A) tuple = (1)
B) tuple = (1,)
C) tuple = [1]
D) tuple = {1}