Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction Data manipulation forms the basis of all programming. This is especially important when working with data structures. For this week's homework assignment you will
Introduction
Data manipulation forms the basis of all programming. This is especially important when working with data structures. For this week's homework
assignment you will be tasked to work with lists and dictionaries to create a very simple portfolio. Below is a list of tasks you are expected to complete
when working with lists and dictionaries
Expectations
For this assignment you are expected to create a program that does the following:
Declare a list that contains stocks a user holds in their portfolio. The portfolio must contain at least items
Report a range of items in that portfolio. Print out the index of each holding in this range
Insert a new holding into the portfolio
Remove a stock from the portfolio
Create a dictionary where the value of each key is the amount of shares held for that stock
Add a new stock to the dictionary and a number of shares associated with that holding
Calculate the total number of shares held in the portfoliol
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started