Dictionary Key Intersection
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L5
Problem
Given two dicts d1 and d2, return a new dict containing keys present in BOTH, with values from d1. Return the dict; key ordering should be sorted ascending.
Summary
Two dictionaries. What do they share?
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.