• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 13 pages
Exam (elaborations)

WGU D335 Practice Test 2 Question and answers verified to pass 2026

Document preview thumbnail
Preview 2 out of 13 pages

WGU D335 Practice Test 2 Question and answers verified to pass 2026

Content preview

WGU D335 Practice Test 2
Question and answers verified to
pass 2026

1. Create a solution that accepts three times_traveledA =
integer inputs representing the int(input()) times_traveledB
= int(input())
number of times an employee
times_traveledC =
travels to a job site. Output the
int(input())
total distance traveled to two decimal places employeeA =
15.62 #miles given the following miles per employee com-
employeeB = 41.85 #miles mute to the job site. Output the
total distance employeeC = 32.67 #miles
traveled to two decimal places given the distance_traveledA =
fol-lowing miles per employee times_traveledA * employeeA
commute to the job site: distance_traveledB =
Employee A: 15.62 times_traveledB * employeeB
miles Employee B: distance_traveledC =
41.85 miles Employee times_traveledC * employeeC
C: 32.67 miles total_miles_traveled =
distance_travele-dA +
distance_traveledB + distance_trav-
eledC
print('Distance: {:.2f}
miles'.format(to-
tal_miles_traveled))
2. Create a solution that accepts an input
iden-tifying the name of a text file, for file_name = input()
example, "WordTextFile1.txt". Each with open(file_name, 'r') as f:
text file contains word1 = str(f.readline()).strip()
three rows with one word per row. Using the word2 = str(f.readline()).strip()
open() function and write() and read() word3 = str(f.readline()).strip()
meth-ods, interact with the input text
file to write a new sentence string f = open(file_name, 'r')
composed of the three
1/
13

, existing words to the end of the file contents lines = f.read().splitlines()
on a new line. Output the new file lines = ' '.join(lines)
contents. f.close()
print(f'{word1}\n{word2}\n{word3}\
n{lines

3. Create a solution that accepts an ounces_per_pound = 16
integer input representing any pounds_per_ton = 2000
number of ounces.




2/
13

Document information

Uploaded on
June 6, 2026
Number of pages
13
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.49

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

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.
flyhigher329
3.7
(61)
Sold
386
Followers
175
Items
18498
Last sold
5 days ago




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