• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 231 páginas
Examen

Python Programming Practice Question Bank: 295+ Questions with Verified Answers & Detailed Rationales

Document preview thumbnail
Vista previa 4 fuera de 231 páginas

Master Python programming with this comprehensive practice question bank featuring 295+ multiple-choice questions with verified answers and detailed rationales. This complete study resource covers all essential Python topics from fundamentals to advanced concepts, perfect for exam preparation, interview practice, and skill assessment. Key Features: 295+ exam-style questions with correct answers Detailed rationales explaining the "why" behind each answer Organized into 11 comprehensive sections 231 pages of in-depth content Covers beginner to intermediate level concepts Perfect for Python certification preparation What's Included: Python Fundamentals & Syntax (print, comments, data types) Variables, Data Types & Type Conversion (int, float, str, bool) Operators & Expressions (arithmetic, comparison, logical) Strings & String Methods (slicing, formatting, manipulation) Control Flow: Conditionals (if/elif/else) Loops & Iteration (for, while, range, enumerate) Functions & Scope (parameters, return, global, lambda) Data Structures (lists, tuples, dictionaries, sets) File Input/Output (open, read, write, with statement) Exception Handling & Debugging (try/except/finally) Comprehensive Mixed Topics Perfect for: Python beginners and intermediate learners Exam preparation (PCEP, PCAP certification) Coding interview preparation University programming courses Self-paced learning and skill assessment Build your Python programming confidence with this complete practice question bank covering syntax, data structures, control flow, functions, file I/O, and exception handling. Pass your exams with confidence!

Vista previa del contenido

Page 1 of 231



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`

Información del documento

Subido en
17 de agosto de 2026
Número de páginas
231
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$29.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
ITSJEREGUIDES
4.3
(10)
Vendido
51
Seguidores
2
Artículos
2286
Última venta
3 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes