WGU E010 OBJECTIVE ASSESSMENT
FINAL EXAM
COMPREHENSIVE PRACTICE QUESTION
BANK (250+ QUESTIONS)
FOUNDATIONS OF PROGRAMMING
(PYTHON) | 2026-2027 ACADEMIC YEAR
# TABLE OF CONTENTS
| 1 | Python Fundamentals & Syntax | 1-25 |
| 2 | Variables, Data Types, and Type Casting | 26-50 |
| 3 | Operators and Expressions | 51-70 |
| 4 | Control Flow: Conditional Statements (if, elif, else) | 71-90 |
| 5 | Loops and Iteration (for, while) | 91-115 |
| 6 | Loop Control (break, continue, pass) | 116-130 |
| 7 | Functions and Modular Programming | 131-155 |
| 8 | Scope and Namespaces | 156-170 |
| 9 | Data Structures: Lists | 171-190 |
| 10 | Data Structures: Tuples | 191-205 |
| 11 | Data Structures: Dictionaries | 206-225 |
| 12 | Data Structures: Sets | 226-240 |
| 13 | String Manipulation | 241-255 |
| 14 | File Input/Output (File I/O) | 256-270 |
| 15 | Exception Handling | 271-285 |
| 16 | Advanced Concepts & Debugging | 286-300 |
,Page 2 of 230
SECTION 1: PYTHON FUNDAMENTALS & SYNTAX (Questions 1-25)
**Question 1**
What is the correct way to print the text "Hello, World!" to the console in Python?
A) echo("Hello, World!")
B) print("Hello, World!")
C) display("Hello, World!")
D) write("Hello, World!")
**Correct Answer: B**
**Rationale:** The built-in `print()` function is the standard way to output text to the console in
Python. Options A, C, and D are not valid Python functions for console output. `echo()` is used
in some other languages or command-line environments, `display()` is not a built-in Python
function, and `write()` is a method used for file operations, not console output.
---
**Question 2**
Which symbol begins a single-line comment in Python?
A) // (double forward slash)
B) # (pound/hash symbol)
C) /* (forward slash asterisk)
D) -- (double hyphen)
**Correct Answer: B**
,Page 3 of 230
**Rationale:** In Python, the `#` symbol is used to indicate a single-line comment. Everything
after the `#` on that line is ignored by the Python interpreter. `//` is used for floor division, `/* */`
is used for multi-line comments in languages like C/Java but not in Python, and `--` is not a
comment symbol in Python.
---
**Question 3**
Which of the following is a valid variable name in Python?
A) 2ndName
B) my-name
C) _myVariable
D) class
**Correct Answer: C**
**Rationale:** Python variable names must start with a letter (a-z, A-Z) or an underscore (_) and
cannot start with a digit. They cannot contain hyphens or spaces, and they cannot be reserved
keywords. `_myVariable` starts with an underscore and contains only valid characters.
`2ndName` starts with a digit, `my-name` contains a hyphen, and `class` is a reserved keyword.
---
**Question 4**
What is the data type of the value `3.14` in Python?
A) int
, Page 4 of 230
B) float
C) str
D) bool
**Correct Answer: B**
**Rationale:** Any number that contains a decimal point is a floating-point number (`float`) in
Python. Integers (`int`) are whole numbers without a decimal point. `3.14` is clearly a decimal
number, making it a float. Strings (`str`) are sequences of characters enclosed in quotes, and
Booleans (`bool`) are `True` or `False` values.
---
**Question 5**
What is the output of the following code?
```python
print(type(10))
```
A) `<class 'int'>`
B) `<class 'float'>`
C) `<class 'str'>`
D) `<class 'bool'>`
**Correct Answer: A**
**Rationale:** The `type()` function returns the data type of the provided value. `10` is an
integer literal, so `type(10)` returns `<class 'int'>`. This indicates that the value 10 belongs to the
integer class in Python.