150+ PRACTICE QUESTIONS & ANSWERS | ULTIMATE EXAM PREP & STUDY GUIDE
| PYTHON FUNDAMENTALS, PROGRAMMING CONCEPTS, CODING PRACTICE &
DETAILED EXPLANATIONS | COMPREHENSIVE OBJECTIVE
CORE DOMAINS
• Python Syntax and Basic Operations
• Data Types, Variables, and Type Conversion
• Control Flow: Conditionals and Loops
• Functions, Scope, and Parameter Passing
• Data Structures: Lists, Tuples, Dictionaries, Sets
• String Manipulation and Slicing
• File Input/Output and Exception Handling
• Built-in Functions, Methods, and Debugging
INTRODUCTION
This assessment evaluates the foundational Python programming competencies required
for the WGU E010 Objective Assessment. It covers essential syntax, data types, control
structures, function design, and collection manipulation, with emphasis on code tracing,
debugging, and practical problem-solving. The examination utilizes multiple-choice and
scenario-based questions to measure both conceptual understanding and applied coding
reasoning. Emphasis is placed on real-world application, ensuring that candidates can
interpret Python behavior, predict outputs accurately, and write defensible solutions. This
resource is designed to simulate the rigor and format of the proctored assessment while
reinforcing the "why" behind each correct answer.
SECTION ONE: QUESTIONS 1–150
1. A student is writing a Python script and needs to store the value 3.14 for later
calculation. Which built-in data type will Python assign to this literal?
,A. int
B. float
C. str
D. bool
B
RATIONALE: Any numeric literal containing a decimal point is interpreted by Python as a
floating-point number (float). Integers (int) represent whole numbers without a decimal
component, and str is used for text sequences.
2. An instructor asks a student to verify the type of the expression . The
student runs print(type()). What output should the student expect?
A. <class 'int'>
B. <class 'float'>
C. <class 'double'>
D. <class 'str'>
B
RATIONALE: In Python 3, the single forward slash (/) performs true division and always
returns a float, even when the operands divide evenly. The result 5.0 is of type float .
3. A programmer needs to create a variable that cannot be modified after its initial
assignment. Which of the following data types satisfies this requirement?
A. list
B. dict
C. set
D. tuple
D
,RATIONALE: Tuples are immutable sequences; their contents cannot be altered after
creation. Lists, dictionaries, and sets are mutable and permit item assignment or
modification .
4. A student writes the expression 3 * "ab" and is unsure of the result. What will
Python produce?
A. "ababab"
B. "ab3"
C. An error
D. "aaabbb"
A
RATIONALE: Multiplying a string by an integer repeats the string that many times. The
expression 3 * "ab" concatenates the string three times, yielding "ababab" .
5. An analyst needs to determine the remainder of 10 divided by 3. Which
operator should be used, and what is the result?
A. The / operator; result is 3.33
B. The // operator; result is 3
C. The % operator; result is 1
D. The ** operator; result is 9
C
RATIONALE: The modulo operator (%) returns the remainder of integer division. 10
divided by 3 is 3 with a remainder of 1, so 10 % 3 evaluates to 1 .
6. A developer is tracing code and encounters the expression 2 ** 3. What value
does this expression produce?
A. 6
B. 8
, C. 9
D. 5
B
RATIONALE: The double asterisk (**) is the exponentiation operator in Python. 2 ** 3
means 2 raised to the power of 3, which equals 8 .
7. A student needs to extract the first four characters from the string "computer".
Which slicing expression correctly accomplishes this task?
A. 'computer'[1:4]
B. 'computer'[0:4]
C. 'computer'[0:3]
D. 'computer'[1:5]
B
RATIONALE: Python string slicing uses a start:stop notation where the start index is
inclusive and the stop index is exclusive. To get indices 0, 1, 2, and 3 (four characters),
the correct slice is [0:4] .
8. A programmer wants to access the last character of a string variable named text
without knowing the string's length. Which expression reliably returns the final
character?
A. text[len(text)]
B. text[-1]
C. text[last]
D. text[0]
B
RATIONALE: Negative indexing in Python counts from the end of the sequence. The
index -1 always refers to the last character, regardless of the string's length .