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 ACTUAL QUESTIONS AND ANSWERS 2026 UPDATE 100% CORRECT ALREADY GRADED A+ LATEST VERSION

Rating
-
Sold
-
Pages
24
Grade
A+
Uploaded on
21-02-2026
Written in
2025/2026

"Create a solution that accepts an integer input representing the index value for any any of the five elements in the following list: various_data_types = [516, 112.49, True, "meow", ("Western", "Governors", "University"), {"apple": 1, "pear": 5}] Using the built-in function type() and getting its name by using the .name attribute, output data type (e.g., int", "float", "bool", "str") based on the input index value of the list element. - CORRECT ANSWER=index_value = int(input()) name = various_data_types[index_value] data_type = type(name).__name__ print(f"Element {index_value}: {data_type}")" "Create a solution that accepts an integer input. Import the built-in module math and use its factorial() method to calculate the factorial of the integer input. Output the value of the factorial, as well as a Boolean value identifying whether the factorial output is greater than 100. - CORRECT ANSWER=import math fact = int(input()) x = rial(fact) print(x) if x 100: print('True') else: print('False')"

Show more Read less
Institution
D335
Course
D335

Content preview

WGU D335 INTRO TO PYTHON OA
OBJECTIVE ASSESSMENT ACTUAL
QUESTIONS AND ANSWERS 2026
UPDATE 100% CORRECT ALREADY
GRADED A+ LATEST VERSION
"Create a solution that accepts an integer input representing the index value for any any of the
five elements in the following list:
various_data_types = [516, 112.49, True, "meow", ("Western", "Governors", "University"),
{"apple": 1, "pear": 5}]
Using the built-in function type() and getting its name by using the .name attribute, output data
type (e.g., int", "float", "bool", "str") based on the input index value of the list element. -
CORRECT ANSWER=>index_value = int(input())
name = various_data_types[index_value]
data_type = type(name).__name__
print(f"Element {index_value}: {data_type}")"

"Create a solution that accepts an integer input. Import the built-in module math and use its
factorial() method to calculate the factorial of the integer input. Output the value of the
factorial, as well as a Boolean value identifying whether the factorial output is greater than 100.
- CORRECT ANSWER=>import math
fact = int(input())
x = math.factorial(fact)
print(x)
if x > 100:
print('True')
else:
print('False')"

"Create a solution that accepts any three integer inputs representing the base (b1, b2) and
height (h) measurements of a trapezoid in meters. Output the exact area of the trapezoid in

1|Page

,square meters as a float value. The exact area of a trapezoid can be calculated by finding the
average of the two base measurements, then multiplying by the height measurement.
Trapezoid Area Formula:A = [(b1 + b2) / 2] * h - CORRECT ANSWER=>b1 = int(input())
b2 = int(input())
h = int(input())
area_value = ((b1 + b2) /2) * h
print('Trapezoid area: {:.1f} square meters'.format(area_value))"

"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. - CORRECT ANSWER=>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')"

"Create a solution that accepts five integer inputs. Output the sum of the five inputs three
times, converting the inputs to the requested data type prior to finding the sum.
First output: sum of five inputs maintained as integer values
Second output: sum of five inputs converted to float values
Third output: sum of five inputs converted to string values (concatenate) - CORRECT
ANSWER=>num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input())
num5 = int(input())
first_output = num1 + num2 + num3 + num4 + num5
second_output = float(num1) + float(num2) + float(num3) + float(num4) + float(num5)
third_output = str(num1) + str(num2) + str(num3) + str(num4) + str(num5)
print('Integer: {}'.format(first_output))
print('Float: {}'.format(second_output))
print('String: {}'.format(third_output))"

"Create a solution that accepts a string input representing a grocery store item and an integer
input identifying the number of items purchased on a recent visit. The following dictionary
purchase lists available items as the key with the cost per item as the value.

2|Page

, purchase = {"bananas": 1.85, "steak": 19.99, "cookies": 4.52, "celery": 2.81, "milk": 4.34}
Additionally,
If fewer than ten items are purchased, the price is the full cost per item.
If between ten and twenty items (inclusive) are purchased, the purchase gets a 5% discount.
If twenty-one or more items are purchased, the purchase gets a 10% discount.
Output the chosen item and total cost of the purchase to two decimal places. - CORRECT
ANSWER=>store_item = input()
num_items = int(input())
total_cost = purchase[store_item] * num_items
if num_items < 10:
print(store_item, "${:.2f}".format(total_cost))
if num_items in range(10,21):
discount = total_cost * 0.05
total_cost = total_cost - discount
print(store_item, '${:.2f}'.format(total_cost))
if num_items >= 21:
discount = total_cost * 0.10
total_cost = total_cost - discount
print(store_item, '${:.2f}'.format(total_cost))"

"Create a solution that accepts an integer input representing a 9-digit unformatted student
identification number. Output the identification number as a string with no spaces. - CORRECT
ANSWER=>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}')"

"Create a solution that accepts an integer input identifying how many shares of stock are to be
purchased from the Old Town Stock Exchange, followed by an equivalent number of string
inputs representing the stock selections. The following dictionary stock lists available stock
selections as the key with the cost per selection as the value.
stocks = {'TSLA': 912.86 , 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI': 6.92, 'KIRK': 8.72, 'AURA': 22.12,
'AMZN': 141.28, 'EMBK': 12.29, 'LVLU': 2.33}
Output the total cost of the purchased shares of stock to two decimal places. - CORRECT
ANSWER=>num_stock = int(input())
total_cost = 0

3|Page

Written for

Institution
D335
Course
D335

Document information

Uploaded on
February 21, 2026
Number of pages
24
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$18.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.
ExcelHub Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
29
Member since
1 year
Number of followers
0
Documents
1077
Last sold
5 months ago
Excel-Hub YOUR TRUSTED HUB FOR EXCEPTIONAL STUDY RESOURCES!

Welcome to Excel-Hub your go-to source for high-quality test banks and study materials designed to help you excel academically. I offer a comprehensive range of resources including test banks, solution manuals, and other study materials, all meticulously curated to ensure accuracy and effectiveness. They are affordable, well discounted especially the package deals and instantly available, making your learning experience seamless and efficient. Trust Excel-Hub to be your partner in academic success, providing the tools you need to achieve your educational goals. I understand the importance of high-quality, dependable materials in your academic journey. That’s why every document in my store is thoughtfully created to meet your specific needs, ensuring you have the tools to succeed with confidence. Be sure to Excel! I’d love to hear about your experience! Please leave a review of your experience with the study documents.

Read more Read less
4.0

3 reviews

5
1
4
1
3
1
2
0
1
0

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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions