Python Morsels
2 minutes
A sequence is an ordered collection you can index by position: strings, lists, and tuples are all sequences, so seq[0], seq[-1], and slices like seq[1:4] all work. Some sequences change length as you go (lists), others cannot (tuples, strings) — being a sequence is about order and positional access, not about size being fixed. Sets and dictionaries are not sequences: they have no positions, so asking a set for its "first" element raises an error.