Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
-
Pages
77
Grade
A+
Uploaded on
18-01-2026
Written in
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]?

Show more Read less
Institution
WGU D335 INTRO TO PYTHON
Course
WGU D335 INTRO TO PYTHON

Content preview

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

Written for

Institution
WGU D335 INTRO TO PYTHON
Course
WGU D335 INTRO TO PYTHON

Document information

Uploaded on
January 18, 2026
Number of pages
77
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$14.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CLOUND Exam
View profile
Follow You need to be logged in order to follow users or courses
Sold
623
Member since
2 year
Number of followers
389
Documents
11531
Last sold
6 days ago
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 reviews

5
64
4
16
3
29
2
3
1
10

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions