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}