Question: Write a function to print a dictionary where the keys are numbers between 1 and 15 (both included) and the values are the cubes of

Write a function to print a dictionary where the keys are numbers between 1 and 15 (both included) and the values are the cubes of the keys.


Write a function that takes two dicts as parameters, and returns one dict with only the key:value pairs in common. If the values are different for a key, they are not included.
Sample dictionary: {'key1': 1, 'key2': 3, 'key3': 2}, {'key1': 1, 'key2': 2}
Return: {'key1': 1}

Extension: Change the function to take a list of dicts and perform the same logic on any number of dicts.


Write code that performs a pretend POST for a hypothetical new major in CCT that requires CCT109, 110, and 111. The program should remove any students who don't make POST from dictionary of students. See attached starter code. Remember that a student needs 65% in each required course, as well as a 70% average in the 3 courses to be selected. FYI, the second number is hypothetical and changes each year; this is only a simulation.

To run the starter code, try the following command from a prompt:

pip install names

orĀ 

pip3 install names

If all else fails, here's a version with a hardcoded static list of students

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the code for your first request to print a dictionary with keys as numbers between 1 and 15 an... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!