Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Built-in Functions Common to Most Data Structures
Summary
12. Summary

Instruction

Very well done! It's time to wrap things up. First, let's review what we covered in this section:

  1. min(elements) and max(elements) can be used to find the smallest/largest item in any data structure that can be iterated over with a for loop.
  2. min(elements) and max(elements) can be used to find the smallest/largest number, the first/last string (alphabetically), or the first/last character (alphabetically).
  3. sum(elements) finds the sum of all elements in a data structure. It only works when all the elements are numbers.
  4. elements.count(item) returns the number of occurrences of item in elements.
  5. elements.index(item) returns the index of the first occurrence of item in elements. It throws a ValueError if there is no such item.

Are you ready for a short quiz?

Exercise

Click Next exercise to continue.