WGU E010 FOUNDATIONS OF
PROGRAMMING (PYTHON)
OBJECTIVE ASSESSMENT (OA)
PRACTICE QUESTION BANK
250+ MULTIPLE-CHOICE QUESTIONS
WITH VERIFIED ANSWERS AND
DETAILED RATIONALES **ACADEMIC
YEAR:** 2026–2027
# TABLE OF CONTENTS
| Section | Topic | Questions |
|---------|-------|-----------|
| **Section 1** | Python Fundamentals & Syntax | 1–25 |
| **Section 2** | Variables, Data Types, and Type Conversion | 26–55 |
| **Section 3** | Operators and Expressions | 56–80 |
| **Section 4** | Strings and String Manipulation | 81–105 |
| **Section 5** | Control Flow: Conditionals (if/elif/else) | 106–130 |
| **Section 6** | Loops and Iteration (for/while) | 131–160 |
| **Section 7** | Functions and Scope | 161–190 |
| **Section 8** | Data Structures: Lists, Tuples, Dictionaries, Sets | 191–225 |
| **Section 9** | File Input/Output | 226–240 |
| **Section 10** | Exception Handling and Debugging | 241–255 |
| **Section 11** | Comprehensive/Mixed Topics | 256–260+ |
,Page 2 of 231
# SECTION 1: PYTHON FUNDAMENTALS & SYNTAX
### Question 1
**What is the output of the following Python code?**
```python
print("Hello, World!")
```
A) `Hello, World!`
B) `"Hello, World!"`
C) `print("Hello, World!")`
D) An error occurs
---
**Correct Answer: A**
**Rationale:** The `print()` function outputs the string literal to the console without the
quotation marks. The quotes are used only to denote the string in the code; they are not part of
the output. Python executes the `print()` function, which displays the string content to standard
output.
---
### Question 2
**Which of the following is a valid variable name in Python?**
A) `2ndName`
,Page 3 of 231
B) `my-name`
C) `_myVariable`
D) `my variable`
---
**Correct Answer: C**
**Rationale:** Python variable names can start with a letter (A–Z, a–z) or an underscore (`_`).
They cannot start with a digit (eliminating A), cannot contain hyphens (eliminating B), and
cannot contain spaces (eliminating D). Underscores are allowed and commonly used for variable
names.
---
### Question 3
**Which symbol is used for single-line comments in Python?**
A) `//`
B) `#`
C) `/*`
D) `<!--`
---
**Correct Answer: B**
, Page 4 of 231
**Rationale:** The hash character `#` indicates a single-line comment in Python. Everything
after it on the same line is ignored by the Python interpreter. `//` is used for comments in
languages like C++ and Java, `/* */` is used for multi-line comments in C-style languages, and
`<!-- -->` is used for HTML comments.
---
### Question 4
**What is the output of `print(type())`?**
A) `<class 'int'>`
B) `<class 'float'>`
C) `<class 'double'>`
D) `<class 'str'>`
---
**Correct Answer: B**
**Rationale:** In Python 3, the `/` operator performs floating-point division, always returning a
float. Even when dividing two integers that result in a whole number, the result is a float.
Therefore, `` evaluates to `5.0`, and `type(5.0)` returns `<class 'float'>`.
---
### Question 5
**What is the output of `print(10 // 3)`?**
A) `3.33`