Sahaj.blogs

Day page

1 Sept 2023

Study

Python · Dictionaries

Dictionaries for key-value lookups: get() with defaults, iterating items(), insertion order, and counting with Counter.

  • Since Python 3.7, dicts keep insertion order as a language guarantee.
  • d.get(key, default) avoids a KeyError when the key may be missing.

Read the post →