A Collection of New Information

In this chapter, you learned the following:

  • Sets are used in Python to store unordered collections of unique values. They support the same operations as sets in mathematics.

  • Tuples are another kind of Python sequence. Tuples are ordered sequences like lists, except they are immutable.

  • Dictionaries are used to store unordered collections of key/value pairs. The keys must be immutable, but the values need not be.

  • Looking things up in sets and dictionaries is much faster than searching through lists. If you have a program that is doing the latter, consider changing your choice of data structures.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.98.208