Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task: Create a solution that accepts an integer input identifying how many shares of stock are to be purchased from the Old Town Stock Exchange,

Task:
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
Sample Input/Output:
If the input is
3
SOFI
AMZN
LVLU
then the expected output is
Total price: $150.53

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Determine the period of y = 3 sin |7x - O A. O C. OD o O O O

Answered: 1 week ago