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

WGU D335 Introduction to Programming in Python OBJECTIVE ASSESSMENT ACTUAL EXAM 2025/2026 QUESTIONS WITH VERIFIED CORRECT SOLUTIONS || 100% GUARANTEED PASS <BRAND NEW VERSION>

Rating
1.0
(1)
Sold
4
Pages
19
Grade
A+
Uploaded on
15-04-2025
Written in
2024/2025

WGU D335 Introduction to Programming in Python OBJECTIVE ASSESSMENT ACTUAL EXAM 2025/2026 QUESTIONS WITH VERIFIED CORRECT SOLUTIONS || 100% GUARANTEED PASS &lt;BRAND NEW VERSION&gt; 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 &gt;= and student_id &lt;= 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 &gt; 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 &lt; 33: water_state = "Frozen" optional_safety_comment = "Watch out for ice!" elif 33 &lt;= temperature &lt; 80: water_state = "Cold" elif 80 &lt;= temperature &lt; 115: water_state = "Warm" elif 115 &lt;= temperature &lt; 212: water_state = "Hot" elif temperature &gt;= 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
April 15, 2025
Number of pages
19
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

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
111-22-3333 - ANSWER ✓ student_id = int(input())
student_id >= 100000000 and student_id <= 999999999
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)

Reviews from verified buyers

Showing all reviews
6 months ago

1.0

1 reviews

5
0
4
0
3
0
2
0
1
1
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.
ProfBenjamin Havard School
View profile
Follow You need to be logged in order to follow users or courses
Sold
410
Member since
1 year
Number of followers
14
Documents
2869
Last sold
23 hours ago
EXCELLENT ACHIEVERS LIBRARY

As a professional tutor, I provide exceptional assistance with homework, quizzes, and exams across various subjects, including Psychology, Nursing, Biological Sciences, Business, Engineering, Human Resource Management, and Mathematics. I am dedicated to offering high-quality support and ensuring that all work meets scholarly standards. To enhance the effectiveness of our services, I work with a team of experienced tutors to create comprehensive and effective revision materials. Together, we are committed to helping students achieve excellent grades through our collaborative efforts and expertise.

Read more Read less
3.9

75 reviews

5
35
4
11
3
21
2
4
1
4

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