A Summary List

In this chapter, you learned the following:

  • Lists are used to keep track of zero or more objects. The objects in a list are called items or elements. Each item has a position in the list called an index and that position ranges from zero to one less than the length of the list.

  • Lists can contain any type of data, including other lists.

  • Lists are mutable, which means that their contents can be modified.

  • Slicing is used to create new lists that have the same values or a subset of the values of the originals.

  • When two variables refer to the same object, they are called aliases.

  • Module typing contains type List, and this can be used in type contracts to annotate the type of values a particular list is expected to contain.

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

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