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

WGU D335 Introduction to Programming in Python OBJECTIVE ASSESSMENT ACTUAL EXAM Latest 2026 Actual Questions and Verified Answers 2026 / 2027 A+ Verified by Experts

Rating
-
Sold
-
Pages
11
Grade
A+
Uploaded on
01-01-2026
Written in
2025/2026

WGU D335 Introduction to Programming in Python OBJECTIVE ASSESSMENT ACTUAL EXAM Latest 2026 Actual Questions and Verified Answers 2026 / 2027 A+ Verified by Experts WGU D335 Introduction to Programming in Python OBJECTIVE ASSESSMENT ACTUAL EXAM 2025/2026 QUESTIONS WITH VERIFIED CORRECT SOLUTIONS || 100% GUARANTEED PASS <BRAND NEW VERSION> 1. 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. The solution output should be in the format - ANSWER student_id = int(input()) student_id >= and student_id <= part1 = student_id // 1000000 part2 = (student_id // 10000) % 100 part3 = student_id % 10000 formatted_id = f"{part1}-{part2}-{part3}" print(formatted_id) 2. Create a solution that accepts an integer input to compare against the following list: predef_list = [4, -27, 15, 33, -10] Output a Boolean value indicating whether the input value is greater than the maximum value from predef_list The solution output should be in the format Greater Than Max? Boolean_value - ANSWER num = int(input()) boolean_value = False max_value = max(predef_list) if num > max_value: boolean_value = True print(f"Greater Than Max? {boolean_value}") else: print(f"Greater Than Max? {boolean_value}") 3. 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 incompatible integer input is provided. The solution output should be in the format frameworks_element - ANSWER try: index = int(input()) frameworks_element = (frameworks[index]) print(frameworks_element) except (ValueError, IndexError): print("Error") 4. Create a solution that accepts an integer input representing water temperature in degrees Fahrenheit. Output a description of the water state based on the following scale: If the temperature is below 33° F, the water is "Frozen". If the water is between 33° F and 80° F (including 33), the water is "Cold". If the water is between 80° F and 115° F (including 80), the water is "Warm". If the water is between 115° F and 211° (including 115) F, the water is "Hot". If the water is greater than or equal to 212° F, the water is "Boiling". Additionally, output a safety comment only during the following circumstances: If the water is exactly 212° F, the safety comment is "Caution: Hot!" If the water temperature is less than 33° F, the safety comment is "Watch out for ice!" The solution output should be in the format water_state optional_safety_comment - ANSWER temperature = int(input()) water_state = "" optional_safety_comment = "" if temperature < 33: water_state = "Frozen" optional_safety_comment = "Watch out for ice!" elif 33 <= temperature < 80: water_state = "Cold" elif 80 <= temperature < 115: water_state = "Warm" elif 115 <= temperature < 212: water_state = "Hot" elif temperature >= 212: water_state = "Boiling" if temperature == 212: optional_safety_comment = "Caution: Hot!" print(water_state) if optional_safety_comment: print(optional_safety_comment) 5. Reverse Binary - ANSWER Representing an integer in reverse binary by outputting remainders of division by 2 6. __name__ == '__main__' - ANSWER Used to separate the main code from the function's code for unit testing 7. Driving Cost Function - ANSWER Function taking miles per gallon, price per gallon, and miles driven to return the dollar cost 8. Coin Flip Function - ANSWER Function returning 'Heads' or 'Tails' based on a random value of 1 or 0 9. Unit Tests - ANSWER Testing small parts of a program in an isolated manner to ensure they work as expected 10. Unit test - ANSWER Evaluates individual functions for correctness and proper naming, parameters, and return type 11. if __name__ == '__main__': - ANSWER Separates main code from functions' code for unit testing when running as a script 12. kilo_to_pounds() - ANSWER Function that converts weight in kilograms to pounds 13. swap_values - ANSWER Function that swaps the positions of four integers 14. check_integer_string - ANSWER Function that checks if a string represents an integer 15. Mad Libs - ANSWER Activity where user provides words to complete a story in unexpected ways

Show more Read less
Institution
WGU D335 Introduction To Programming In Python
Course
WGU D335 Introduction to Programming in Python









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

Written for

Institution
WGU D335 Introduction to Programming in Python
Course
WGU D335 Introduction to Programming in Python

Document information

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

Subjects

Content preview

WGU D335 Introduction to Programming in
python Objective Assessment Exam
Questions & Answers
1.Create a solution that accepts three integer inputs representing the
number of times an employee travels to a job site. Output the total distance
traveled to two decimal places given the following miles per employee
commute to the job site. Output the total distance traveled to two decimal
places given the following miles per employee commute to the job site:
Employee A: 15.62
miles Employee B:
41.85 miles
Employee C: 32.67 miles: times_traveledA = int(input())
times_traveledB = int(input())
times_traveledC = int(input())
employeeA = 15.62 #miles
employeeB = 41.85 #miles
employeeC = 32.67 #miles
distance_traveledA = times_traveledA *
employeeA distance_traveledB =
times_traveledB * employeeB
distance_traveledC = times_traveledC *
employeeC
total_miles_traveled = distance_traveledA + distance_traveledB +
distance_trav- eledC
print('Distance: {:.2f} miles'.format(total_miles_traveled))

2.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 input text file to write a new sentence string composed of
1/
11

, the three existing words to the end of the file contents on a new line. Output
the new file contents.: file_name = input()
with open(file_name, 'r') as f:
word1 =
str(f.readline()).strip()
word2 =
str(f.readline()).strip()
word3 =
str(f.readline()).strip()

f = open(file_name, 'r')
lines =
f.read().splitlines()
lines = ' '.join(lines)
f.close()
print(f'{word1}\n{word2}\n{word3}\n{lines}')

3.Create a solution that accepts an integer input representing any number
of ounces. Output the converted total number of tons, pounds, and
remaining ounces based on the input ounces value. There are 16 ounces in
a pound and 2,000 pounds in a ton.: ounces_per_pound = 16
pounds_per_ton = 2000
number_ounces = int(input())
tons = number_ounces // (ounces_per_pound * pounds_per_ton)
remaining_ounces = number_ounces % (ounces_per_pound *
pounds_per_ton) pounds = remaining_ounces // ounces_per_pound
remaining_ounces = remaining_ounces %
ounces_per_pound print('Tons: {}'.format(tons))
print('Pounds: {}'.format(pounds))
print('Ounces:
{}'.format(remaining_ounces))

4.Create a solution that accepts an input identifying the name of a CSV file,
2/
11

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.
NurseFerian Walden University
Follow You need to be logged in order to follow users or courses
Sold
1333
Member since
3 year
Number of followers
580
Documents
10864
Last sold
1 day ago
NURSE FERIAN'S

As a tutor, I focus on offering accurate, reliable, and current study materials to support students in their exam preparation and assignments. My goal is to provide the best resources, such as summaries and nursing exam test banks, ensuring that students can buy with confidence. I encourage customers to leave reviews after purchases for quality assurance and to recommend my services to others. Thank you for your support and trust. Success and Goodluck on Your Studies

Read more Read less
3,7

239 reviews

5
98
4
43
3
52
2
15
1
31

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 exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT 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