Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code is in python and is only asking for a function (no main). Please if possible upload a screen shot that is typed and indented

Code is in python and is only asking for a function (no main). Please if possible upload a screen shot that is typed and indented correctly if possible. Thank you image text in transcribed

Solve a Problem intersect Favorite E Show Header Language/Type: Author: Python Collections Maps Marty Stepp (on 2017/07/08) Write a function named intersect that accepts two dicts of strings to integers as parameters and that returns a new dictionary whose contents are the intersection of the two. The intersection of two dictionaries is defined here as the set of keys and values that exist in both dictionaries. So if some value K maps to value V in both the first and second dictionary, include it in your result. If K does not exist as a key in both dictionaries, or if K does not map to the same value V in both dictionaries, exclude that pair from your result. For example, consider the following two dictionaries: 'Janet: 87, Logan': 62, Whitaker: 46, Alyssa': 188, 'Stefanie': 80, Jeff': 88, 'Kim': 52, 'Sylvia': 95) ('Logan': 62, 'Kim: 52, 'Whitaker': 52, 'Jeff: 88, 'Stefanie' 80, 'Brian': 68, Lisa': 83, 'Sylvia': 87) Calling your function on the preceding dictionaries would return the following new dictionary: (Logan-62, Stefanie-88, Jeff-88, Kim-52 Do not modify the dictionaries passed in as parameters Type your Python solution code here: This is a function problem. Write a Python function as described. Do not write a complete program; just the function(s) above Sound F/x Highlighting Submit

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

More Books

Students also viewed these Databases questions