Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python function that takes a portfolio as a list of tuples and returns the same portfolio as a python dictionary. The keys are

Write a Python function that takes a portfolio as a list of tuples and returns the same portfolio as a python dictionary. The keys are ticker names, and the value for each key is a list as follows:
The first item on the list is the number of shares you own,
The second item on the list is the price you paid when you bought the stocks,
The last item on the list is the current price of the stock.
[IN] part2d(portfolio)
[OUT]{'WMT': [12,119.33,119.99],
'AMD': [8,148.13,179.43],
etc}

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

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

Read and summarize Technical Advice Memorandum 201014051.

Answered: 1 week ago

Question

3. An overview of the key behaviors is presented.

Answered: 1 week ago

Question

2. The model is credible to the trainees.

Answered: 1 week ago