Start with inventory = {'apple': 3, 'banana': 5, 'cherry': 7}
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Start with inventory = {'apple': 3, 'banana': 5, 'cherry': 7}. Remove 'banana' using del. Pop 'cherry' and store the popped value in a variable called c. Print inventory, then print c, then print the length of inventory.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.