ruk·si

🐍 Python
Data Structures

Updated at 2017-01-02 23:22

Common data structures in Python:

  • Tuples
  • Lists
  • Arrays
  • Sets
  • Dictionaries
  • Structs

Use dict and set to test membership. They are implemented using hash tables so they are fast.

my_set: set = {'a', 'b', 'c'}
assert 'c' in my_set

Sources