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 FINAL 2025/2026 TEST EXAM REVIEW COMPLETE STUDY QUESTIONS WITH CORRECT VERIFIED ANSWERS 100% GUARANTEED PASS | RATED A+

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
18-09-2025
Written in
2025/2026

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. The solution output should be in the format Total price: $cost_of_stocks - Answer>>> num_stock = int(input()) cost_of_stocks = 0 for _ in range(num_stock): stock_selection = input() if stock_selection in stocks: cost_of_stocks += stocks[stock_selection] print(f"Total price: ${cost_of_stocks:.2f}") Create a solution that accepts an input identifying the name of a CSV file, for example, "". Each file contains two rows of comma-separated values. Import the built-in module csv and use its open() function and reader() method to create a dictionary of key:value pairs for each row of comma-separated values in the specified file. Output the file contents as two dictionaries. The solution output should be in the format {'key': 'value', 'key': 'value', 'key': 'value'} {'key': 'value', 'key': 'value', 'key': 'value'} - Answer>>> import csv input1 = input() with open(input1, "r") as f: data = r(f) for row in data: even = [row[i].strip() for i in range(0, len(row), 2)] odd = [row[i].strip() for i in range(1, len(row), 2)] pair = dict(zip(even, odd)) print(pair) 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 The solution output should be in the format Distance: total_miles_traveled miles - Answer>>> travels = { "A": int(input()), "B": int(input()), "C": int(input()) } miles_per_employee = {"A": 15.62, "B":41.85, "C": 32.67} total_miles_traveled = sum(travels[employee] * miles_per_employee[employee] for employee in travels) print(f"Distance: {total_miles_traveled:.2f} miles") 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"]

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
September 18, 2025
Number of pages
10
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON
FINAL 2025/2026 TEST EXAM REVIEW COMPLETE STUDY
QUESTIONS WITH CORRECT VERIFIED ANSWERS 100%
GUARANTEED PASS | RATED A+
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.

The solution output should be in the format

Total price: $cost_of_stocks - Answer>>> num_stock = int(input())

cost_of_stocks = 0

for _ in range(num_stock):

stock_selection = input()

if stock_selection in stocks:

cost_of_stocks += stocks[stock_selection]

print(f"Total price: ${cost_of_stocks:.2f}")

Create a solution that accepts an input identifying the name of a CSV file, for example,
"input1.csv". Each file contains two rows of comma-separated values. Import the built-in module
csv and use its open() function and reader() method to create a dictionary of key:value pairs for
each row of comma-separated values in the specified file. Output the file contents as two
dictionaries.

The solution output should be in the format

, {'key': 'value', 'key': 'value', 'key': 'value'} {'key': 'value', 'key': 'value', 'key': 'value'} - Answer>>>
import csv

input1 = input()

with open(input1, "r") as f:

data = csv.reader(f)

for row in data:

even = [row[i].strip() for i in range(0, len(row), 2)]

odd = [row[i].strip() for i in range(1, len(row), 2)]

pair = dict(zip(even, odd))

print(pair)

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

The solution output should be in the format

Distance: total_miles_traveled miles - Answer>>> travels = {

"A": int(input()),

"B": int(input()),

"C": int(input())

}

miles_per_employee = {"A": 15.62, "B":41.85, "C": 32.67}

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.
ASTUDYAIDS EGERTTON
View profile
Follow You need to be logged in order to follow users or courses
Sold
10
Member since
2 year
Number of followers
4
Documents
596
Last sold
1 month ago
HOME OF EXAM(s), SUMMARIES, TEST BANKS AND NOTES

All Latest Quality examinations (elaborations) , summaries, study guides for you can easily acquire at any place of interest at any comfortable time. Thank you for your reviews. Growth in knowledge is growth in our future.

2.3

3 reviews

5
1
4
0
3
0
2
0
1
2

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