Question: stocks = { ' TSLA ' : 9 1 2 . 8 6 , ' BBBY ' : 2 4 . 8 4 , 'AAPL':
stocks TSLA: BBBY: 'AAPL': 'SOFI': 'KIRK': 'AURA': 'AMZN': 'EMBK': 'LVLU':
#solution accepts an integer input representing the number of stock selections
#solution accepts string inputs equivalent to the integer input identifying the stock selections
#solution outputs the total cost of stock as "Total price: $ followed by the total cost to decimal places
numofstocks intinput
totalcost
for in rangenumofstocks:
stock inputstripupper
if stock in stocks:
totalcost stocksstock
else:
printfStock stock not found. Skipping."
printfTotal price: $totalcost:f
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
