100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
11
Cijfer
A+
Geüpload op
01-01-2026
Geschreven 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

Meer zien Lees minder
Instelling
WGU D335 Introduction To Programming In Python
Vak
WGU D335 Introduction to Programming in Python









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
WGU D335 Introduction to Programming in Python
Vak
WGU D335 Introduction to Programming in Python

Documentinformatie

Geüpload op
1 januari 2026
Aantal pagina's
11
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

  • wgu d335

Voorbeeld van de inhoud

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

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
NurseFerian Walden University
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1333
Lid sinds
3 jaar
Aantal volgers
580
Documenten
10864
Laatst verkocht
1 dag geleden
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

Lees meer Lees minder
3.7

239 beoordelingen

5
98
4
43
3
52
2
15
1
31

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen