Overview

A data structure is a way of organizing, managing, and storing data that allows efficient modification and access. Different data structures support different functions more efficiently than others. The data structure represents a group of data values, relationships between the values, and the operations and functions that can be used with the data. An example of how a data structure is used is the use of a b-tree index data structure for retrieving data from a relational database. A hash table data structure is used to look up identifiers.

In this assignment you create three data structure types and populate them with data.

Exercise 1 - Create a List to Sum Values

Write a script that sums the values in a list called add_list that contains the following values: (10, 2, -4, 8). Make sure you include a for loop when iterating through the list to sum the values.

Take screenshots of the code and output.

Exercise 2 - Create a Dictionary

Write a script that prints a dictionary where the key numbers are 1, 2, 3, 4, and 5 and the values are the key number times 2. Be sure to use an appropriate loop to iterate through the dictionary when printing the dictionary.

Take a screenshot of your code and the output.

Exercise 3 - Sets and Set Operations

Imagine you have two grocery lists:

Grocery Lists
List A List B
Soap Fish
Oranges Pork Loin
Bananas Paper Plates
Oatmeal Jelly
Fish Soap

Write scripts that do the following:

1.Prints names of products common to both lists.

2.Prints names of products that are in at least one of the two lists.

Take a screenshot of your code and the output.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.