Get one quick Python tip each week Weekly Python advice: one quick Python tip every week

Removing a dictionary key PREMIUM

Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
4 min. read 3 min. video Python 3.7—3.11
Python Morsels
Watch as video
02:54

Let's talk about removing items from a dictionary in Python.

Using Python's del statement

Here we have a dictionary called rooms:

...

Concepts Beyond Intro to Python

Intro to Python courses often skip over some fundamental Python concepts.

Sign up below and I'll share ideas new Pythonistas often overlook.

Python Morsels
Watch as video
02:54