Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 4 fuera de 54 páginas
Examen

WGU D335 Introduction to Programming in Python OBJECTIVE ASSESSMENT ACTUAL EXAM 2025/2026 QUESTIONS WITH VERIFIED CORRECT SOLUTIONS || 100% GUARANTEED PASS BRAND NEW VERSION

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

WGU D335 Introduction to Programming in Python OBJECTIVE ASSESSMENT ACTUAL EXAM 2025/2026 QUESTIONS WITH VERIFIED CORRECT SOLUTIONS || 100% GUARANTEED PASS BRAND NEW VERSION

Vista previa del contenido

WGU D335 Introduction to Programming in Python
OBJECTIVE ASSESSMENT ACTUAL EXAM 2025/2026
QUESTIONS WITH VERIFIED CORRECT SOLUTIONS ||
100% GUARANTEED PASS <BRAND NEW VERSION>
WGU D335 Python Practice Exam

1. What is the output of the following code?

python

x=5

y=2

result = x // y

print(result)

A) 2.5
B) 2 ✓
C) 3
D) 2.0

2. Which data type is mutable in Python?
A) int
B) str
C) tuple
D) list ✓

3. What keyword is used to define a function in Python?
A) func
B) define
C) def ✓
D) function

4. What will print(type(10.0)) output?
A) <class 'int'>
B) <class 'float'> ✓
C) <class 'double'>
D) <class 'number'>

,5. Which of the following is a valid variable name?
A) 2nd_var
B) my-variable
C) _my_var ✓
D) global

6. What does the append() method do?
A) Adds an element to the beginning of a list.
B) Adds an element to the end of a list. ✓
C) Removes the last element of a list.
D) Sorts the list in ascending order.

7. How do you start a single-line comment in Python?
A) //
B) /*
C) # ✓
D) --

8. What is the result of "hello" + "world"?
A) hello world
B) helloworld ✓
C) "hello"+"world"
D) An error

9. Which operator is used for exponentiation?
A) ^
B) ** ✓
C) //
D) %

10. What is the purpose of the if __name__ == "__main__": statement?
A) To ensure a script runs only if it is the main program being executed. ✓
B) To define the main function of a program.
C) To check if the user is running Python 3.
D) To import a module safely.

11. What does the open() function's 'w' mode do?
A) Opens a file for reading.
B) Opens a file for appending.

,C) Opens a file for writing (truncates the file first). ✓
D) Opens a file for both reading and writing.

12. Which collection is unordered and does not allow duplicate elements?
A) List
B) Tuple
C) Set ✓
D) Dictionary

13. What is the output?

python

my_list = [1, 2, 3, 4]

print(my_list[1:3])

A) [1, 2]
B) [2, 3] ✓
C) [1, 2, 3]
D) [2, 3, 4]

14. How do you create a tuple with a single element?
A) t = (1)
B) t = 1,
C) t = (1,) ✓
D) t = tuple(1)

15. What keyword is used to handle exceptions?
A) catch
B) throw
C) try and except ✓
D) error

16. What will the following code print?

python

for i in range(3):

print(i, end=' ')

A) 0 1 2 ✓
B) 1 2 3

, C) 0 1 2 3
D) 1 2

17. Which method is used to remove a key-value pair from a dictionary?
A) remove()
B) pop() ✓
C) delete()
D) discard()

18. What is the correct way to import only the sqrt function from the math module?
A) import math.sqrt
B) import sqrt from math
C) from math import sqrt ✓
D) from math sqrt

19. What is a correct example of a dictionary?
A) {1, 2, 3}
B) [1: 'a', 2: 'b']
C) {'name': 'Alice', 'age': 30} ✓
D) ('a', 'b', 'c')

20. What does the strip() method do for a string?
A) Splits the string into a list.
B) Removes leading and trailing whitespace. ✓
C) Converts the string to uppercase.
D) Reverses the string.

21. What is the output of bool("False")?
A) False
B) True ✓
C) None
D) An error

22. Which of these is a valid f-string?
A) f"My name is {name}" ✓
B) "fMy name is {name}"
C) f"My name is (name)"
D) "My name is f{name}"

23. What is the scope of a variable defined inside a function?
A) Global

Información del documento

Subido en
22 de noviembre de 2025
Número de páginas
54
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$11.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.
TrustedExaminer
4.0
(9)
Vendido
83
Seguidores
4
Artículos
3656
Última venta
16 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