Rédigé par des étudiants ayant réussi Disponible immédiatement après paiement Lire en ligne ou en PDF Mauvais document ? Échangez-le gratuitement 4,6 TrustPilot
logo-home
Examen

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

Note
-
Vendu
-
Pages
77
Grade
A+
Publié le
18-01-2026
Écrit 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]?

Montrer plus Lire moins
Établissement
WGU D335 INTRO TO PYTHON
Cours
WGU D335 INTRO TO PYTHON

Aperçu du contenu

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

École, étude et sujet

Établissement
WGU D335 INTRO TO PYTHON
Cours
WGU D335 INTRO TO PYTHON

Infos sur le Document

Publié le
18 janvier 2026
Nombre de pages
77
Écrit en
2025/2026
Type
Examen
Contient
Questions et réponses

Sujets

€13,41
Accéder à l'intégralité du document:

Mauvais document ? Échangez-le gratuitement Dans les 14 jours suivant votre achat et avant le téléchargement, vous pouvez choisir un autre document. Vous pouvez simplement dépenser le montant à nouveau.
Rédigé par des étudiants ayant réussi
Disponible immédiatement après paiement
Lire en ligne ou en PDF

Faites connaissance avec le vendeur

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
CLOUND Exam
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
623
Membre depuis
2 année
Nombre de followers
389
Documents
11531
Dernière vente
6 jours de cela
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 revues

5
64
4
16
3
29
2
3
1
10

Documents populaires

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions