Python includes a number of built-in functions—these are global Python functions that can be called from any Python code without importing additional modules. For example, you can always call the print
built-in function to output text.
Several of the built-in functions (all
, any
, max
, and min
among them) take iterables of values as their argument and return a single value. An iterable is a Python object that can be “iterated over”, that is, it will return items in a sequence such that you can use it in a for
loop. Built-in functions are useful when, for example, you want to determine if all or any of the elements in a list meet a certain criteria, or find the largest or smallest element in a list.
In this tutorial, you will use the built-in functions all
, any
, max
, and min
.
To get the most out of this tutorial, it is recommended to have:
#python #programming