Tag: tuple

Tuple Unpacking

Tuple Unpacking

Something few beginning Python programmers know about is tuple unpacking. This allows you to do fun stuff like returning multiple values from a function. Everyone knows how to create a tuple, right?

Well using tuple unpacking, you can get all values from a tuple in one expression and store them in their own variables.

+ Read More

Improving your code readability with namedtuples

Improving your code readability with namedtuples

If you’ve programmed in Python for some time you’ve no doubt used to tuples to move around data in your code. Tuples are a very useful way of grouping related data in a single variable. One issue that often comes up with tuples is that they are very easy to abuse…