Properties of a Python set
  • Items are not ordered
  • Items are not changeable – they can only be added/removed
  • Items are not indexed
Are Python sets ordered?

No

Are items in a Python set changeable?

No, they can only be added/removed from the set

Are items in a Python set indexed?

No

Python dict.get() vs dict[key]
  • dict[key] returns the value or raises KeyError if the key is missing.
  • dict.get(key, default) returns the value or default if missing; the default is None when omitted.