Sahaj.blogs

Day page

5 Sept 2023

Study

Python · Sets

Sets for uniqueness and fast membership tests, plus union, intersection and difference.

  • {} is an empty dict, not an empty set; use set().
  • Membership tests on a set are O(1) on average, versus O(n) on a list.

Read the post →