100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

WGU D335 Intro to Python | OA | Objective Assessment | 15 Actual Questions and Answers | 2025 Update | 100% Correct.

Rating
4.0
(4)
Sold
15
Pages
21
Grade
A+
Uploaded on
16-05-2025
Written in
2024/2025

WGU D335 Intro to Python | OA | Objective Assessment | 15 Actual Questions and Answers | 2025 Update | 100% Correct.











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 16, 2025
Number of pages
21
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

5/16/25, 10:40 PM WGU D335 Introduction to python
OA
WGU D335 Intro to Python | OA | Objective Assessment | 15
Actual Questions and Answers | 2025 Update | 100% Correct.

Correct 15

Incorrect


WGU D335

15 Correct terms




Questions and answers



1 of 15

Term


Create a solution that accepts an integer input representing the age
of a pig. Import the existing module pigAge and use its pre-built
pigAge_converter() function to calculate the human equivalent age
of a pig. A year in a pig's life is equivalent to five years in a human's
life. Output the human-equivalent age of the pig.



Give this one a go later!

,5/16/25, 10:40 PM WGU D335 Introduction to python
OA
import csv
input1 = input()
with open(input1, "r") as f:
data = [row for row in csv.reader(f)]
for row in data:
even = [row[i].strip() for i in range(0, len(row), 2)]
odd = [row[i].strip() for i in range(1, len(row), 2)]
pair = dict(zip(even, odd))
print(pair)

import pigAge
def pigAge_converter(pig_age):
return pig_age * 5
pig_age = int(input())
converted_pig_age = pigAge_converter(pig_age)
print(f'{pig_age} is {converted_pig_age} in human years')




student_id = int(input())
student_id_string = str(student_id)
first3 = student_id_string[0:3]
second2 = student_id_string[3:5]
third4 = student_id_string[5:]
print(f'{first3}-{second2}-{third4}')




import math
fact = int(input())
x = math.factorial(fact)
print(x)
if x > 100:
print('True')
else:
print('False')


Don't know?




2 of 15

, 5/16/25, 10:40 PM WGU D335 Introduction to python
OA
Definition



index_value = int(input())
try:
if index_value == 0:
print(frameworks[0])
if index_value == 1:
print(frameworks[1])
if index_value == 2:
print(frameworks[2])
if index_value == 3:
print(frameworks[3])
if index_value == 4:
print(frameworks[4])
if index_value == 5:
print(frameworks[5])
if index_value > 5:
print(frameworks[index_value])
except:
print('Error')

Give this one a go later!



Create a solution that accepts one integer input representing the index
value for any of the string elements in the following list:
frameworks = ["Django", "Flask", "CherryPy", "Bottle", "Web2Py",
"TurboGears"]
Output the string element of the index value entered. The solution should
be placed in a try block and implement an exception of "Error" if an incom
mypatible integer input is provided




Create a solution that accepts an input identifying the name of a text file, for
example, "WordTextFile1.txt". Each text file contains three rows with one word per
row. Using the open() function and write() and read() methods, interact with the

Reviews from verified buyers

Showing all 4 reviews
1 week ago

4 months ago

5 months ago

5 months ago

We’re really grateful and appreciate you taking the time to share your rating with us.

6 months ago

6 months ago

We hope to welcome you back again soon! Let us know if you need anything in the future

4.0

4 reviews

5
1
4
2
3
1
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

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.
Wiseman NURSING
View profile
Follow You need to be logged in order to follow users or courses
Sold
6650
Member since
4 year
Number of followers
3835
Documents
25870
Last sold
1 hour ago
Testsprint

Updated exams .Actual tests 100% verified.ATI,NURSING,PMHNP,TNCC,USMLE,ACLS,WGU AND ALL EXAMS guaranteed success.Here, you will find everything you need in NURSING EXAMS AND TESTBANKS.Contact us, to fetch it for you in minutes if we do not have it in this shop.BUY WITHOUT DOUBT!!!!Always leave a review after purchasing any document so as to make sure our customers are 100% satisfied. **Ace Your Exams with Confidence!**

3.9

1366 reviews

5
672
4
246
3
210
2
76
1
162

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