• ¿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 66 páginas
Examen

WGU E010 Foundations of Programming (Python) |OA| Objective Assessment | 100+ Questions & Answers | 2026 Updated Study Guide

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

WGU E010 Foundations of Programming (Python) |OA| Objective Assessment | 100+ Questions & Answers | 2026 Updated Study Guide

Vista previa del contenido

WGU E010 Foundations of Programming (Python) OA |
100+ Questions & Answers | 2026 Updated Study Guide
Python Fundamentals & Syntax
Question 1

Which statement correctly describes the purpose of Python indentation?

A. It determines the data type of a variable
B. It defines blocks of code such as those inside loops and conditional statements
C. It converts strings into integers
D. It determines the order in which variables are created

Correct Answer: B. It defines blocks of code such as those inside loops and conditional
statements

Rationale:
Python uses indentation to define the beginning and end of code blocks. For example, statements
belonging to an if, for, or while block must be consistently indented. Unlike languages that
commonly use braces {}, Python relies on indentation as part of its syntax.



Question 2

Which line correctly assigns the integer value 25 to a variable named age?

A. integer age = 25
B. age == 25
C. age = 25
D. 25 = age

Correct Answer: C. age = 25

Rationale:
The assignment operator = assigns a value to a variable. Therefore, age = 25 stores the integer
25 in the variable age.

The == operator is used for comparison, not assignment.



Question 3

,What is displayed by the following code?

print("Python")
print("Programming")

A. Python Programming on one line
B. PythonProgramming on one line
C. Python followed by Programming on the next line
D. Nothing because two print statements cannot be used consecutively

Correct Answer: C. Python followed by Programming on the next line

Rationale:
By default, print() ends with a newline character. Therefore, each print() statement displays
its argument on a separate line.



Question 4

Which symbol begins a single-line comment in Python?

A. //
B. <!--
C. #
D. /*

Correct Answer: C. #

Rationale:
Python uses the hash symbol (#) to begin a single-line comment.

Example:

# This is a comment
print("Hello")

The Python interpreter ignores everything after # on that line.



Question 5

What will the following code display?

x = 10
x = 20

,print(x)

A. 10
B. 20
C. 30
D. An error because x cannot be reassigned

Correct Answer: B. 20

Rationale:
Python variables can be reassigned. The first statement assigns 10 to x, but the second statement
replaces that value with 20. Therefore, print(x) displays 20.




Variables & Data Types
Question 6

Which Python data type is used to represent a value such as 3.14?

A. int
B. str
C. float
D. bool

Correct Answer: C. float

Rationale:
A floating-point number represents a number containing a decimal component. For example:

price = 3.14

The variable price contains a float.



Question 7

What is the data type of the value "100"?

A. int
B. float
C. str
D. bool

, Correct Answer: C. str

Rationale:
Quotation marks indicate that 100 is being represented as text rather than as a numeric integer.

x = "100"

Here, x is a string.



Question 8

What is the output?

x = 7
y = 2
print(x + y)

A. 5
B. 9
C. 14
D. 72

Correct Answer: B. 9

Rationale:
Both variables contain integers. The + operator performs arithmetic addition:

7 + 2 = 9




Question 9

What is the output?

x = "7"
y = "2"
print(x + y)

A. 9
B. 72
C. 14
D. An error

Correct Answer: B. 72

Información del documento

Subido en
29 de septiembre de 2026
Número de páginas
66
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$15.99

¿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.
professoraxel
3.8
(495)
Vendido
2676
Seguidores
1587
Artículos
20728
Última venta
21 horas 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