Python
Python Tuples: Immutable Sequences
A tuple is a list that cannot change. That single restriction makes it usable as a dictionary key, safe to share, and the natural way to return severa...
Immutable sequences, packing and unpacking, and where a tuple beats a list.
2 notes
A tuple is a list that cannot change. That single restriction makes it usable as a dictionary key, safe to share, and the natural way to return severa...
Unpacking pulls a sequence apart into names in one statement. It powers swapping, loops over pairs, multiple return values and the star syntax.