The Python dictionary

In this article I will tell you more about Python dictionaries.

Dictionaries are the key-value stores in Python. They enable a fast access of elements because of the hash-table like implementation and that the keys have to be unique. Keys and values are separated with a colon (:) and the whole dictionary is defined between curly braces ({}).

This article is an excerpt of my book Python 3 in Anger. For a more detailed version take a look at the book.

Continue reading

Sets in Python 3

A set is an unordered collection of unique items.

Unordered means that this type of collection does not allow indexing and you cannot access their elements through an index like in the case of a list or a tuple.

Unique means that every element is only once in the set even if you put the same element multiple times into the set.

Naturally you can mix up types in the string just as with a list or a tuple.

This article is an excerpt of my book Python 3 in Anger. For a more detailed version take a look at the book.

Continue reading

Tuples in Python

This will be a short article about tuples because sometimes you have to use them — or you just simply encounter them. And for these cases it is good to be versed what they can and what they cannot do.

This article is an excerpt of my book Python 3 in Anger. For a more detailed version take a look at the book.

Continue reading