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
Examen

WGU D335 INTRO TO PYTHON | OA | OBJECTIVE ASSESSMENT WITH ACCURATE SOLUTIONS VERIFIED 2026

Puntuación
-
Vendido
-
Páginas
77
Grado
A+
Subido en
18-01-2026
Escrito en
2025/2026

WGU D335 INTRO TO PYTHON | OA | OBJECTIVE ASSESSMENT WITH ACCURATE SOLUTIONS VERIFIED 2026 You need to read a CSV file and create What is the output of Which of the following correctly concatenates two lists a = [1,2] and b = [3,4]?

Mostrar más Leer menos
Institución
WGU D335 INTRO TO PYTHON
Grado
WGU D335 INTRO TO PYTHON

Vista previa del contenido

WGU D335 INTRO TO PYTHON | OA |
OBJECTIVE ASSESSMENT WITH
ACCURATE SOLUTIONS VERIFIED 2026

Question 1

You want to calculate the human-equivalent age of a pig, knowing one pig
year equals five human years. You are provided a module pigAge with a
function pigAge_converter(). Which of the following correctly converts the
input pig age to human years?

A) pig_age = int(input()); print(pig_age * 5)
B) import pigAge; pig_age = int(input());
print(pigAge.pigAge_converter(pig_age))
C) pig_age = input(); print(pig_age + 5)
D) pigAge_converter(input())

Answer: B




Question 2

You have a list of frameworks: ["Django", "Flask", "CherryPy", "Bottle",
"Web2Py", "TurboGears"]. You want to safely get the element by an index
entered by the user and print “Error” if the index is invalid. Which code
correctly implements this?

A) print(frameworks[int(input())])
B) try: print(frameworks[int(input())]); except: print("Error")
C) index = input(); print(frameworks[index])
D) frameworks.get(input())

Answer: B

,Question 3

You need to read a CSV file and create a dictionary where the even-indexed
columns are keys and odd-indexed columns are values. Which snippet
accomplishes this?

A) import csv; data = csv.reader(open("file.csv")); print(dict(data))
B) import csv; with open("file.csv") as f: data = [row for row in
csv.reader(f)]; print({row[i]: row[i+1] for i in range(0,len(row),2)})
C) with open("file.csv") as f: print(f.readlines())
D) csv.read("file.csv")

Answer: B




Question 4

Which of the following correctly checks whether the factorial of a number is
greater than 100?

A) import math; fact = math.factorial(int(input())); print(fact > 100)
B) fact = int(input()); print(fact*fact > 100)
C) import math; print(math.factorial(input()) > 100)
D) import math; print(fact > math.factorial(100))

Answer: A




Question 5

,You want to format a student ID number 123456789 as 123-45-6789. Which
Python code snippet works correctly?

A) id = "123456789"; print(id[0:3] + "-" + id[3:5] + "-" + id[5:])
B) id = 123456789; print(id[0:3] + "-" + id[3:5] + "-" + id[5:])
C) id = "123456789"; print(id[:3], id[3:5], id[5:])
D) id = 123456789; print(str(id).join("-"))

Answer: A




Question 6

Which of the following is the correct syntax to define a function in Python
that accepts two parameters and returns their sum?

A) def add(a, b): return a + b
B) function add(a, b) { return a + b }
C) add(a, b) = a + b
D) def add: return a + b

Answer: A




Question 7

What is the output of the following code?

x = [1, 2, 3, 4] print(x[1:3])

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

, Answer: B




Question 8

Which of the following statements about Python dictionaries is correct?

A) Keys in a dictionary can be lists.
B) Dictionaries are mutable and unordered collections of key-value pairs.
C) Dictionaries maintain insertion order in all Python versions.
D) Values in a dictionary must be unique.

Answer: B




Question 9

You want to check if a number entered by the user is even or odd. Which
code snippet works correctly?

A) num = int(input()); print("Even" if num % 2 == 0 else "Odd")
B) num = int(input()); print("Even" if num / 2 == 0 else "Odd")
C) num = input(); print(num % 2 == 0)
D) num = int(input()); print("Odd" if num % 2 == 0 else "Even")

Answer: A

Escuela, estudio y materia

Institución
WGU D335 INTRO TO PYTHON
Grado
WGU D335 INTRO TO PYTHON

Información del documento

Subido en
18 de enero de 2026
Número de páginas
77
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$14.99
Accede al documento completo:

¿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

Conoce al vendedor

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.
CLOUND Exam
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
623
Miembro desde
2 año
Número de seguidores
389
Documentos
11531
Última venta
6 días hace
PROF MM

HELLO WELCOME TO THIS PAGE WHERE YOU WILL FIND ALL EXAMS ,STUDY GUIDE ,CASE, TESTBANKS AND ANY OTHER STUDY MATERIALS,

4.0

122 reseñas

5
64
4
16
3
29
2
3
1
10

Documentos populares

Recientemente visto por ti

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