type(), for example, is a function that returns the type of
a value.
Suppose you have the list containing only the heights of
your family, fam: Say that you want to get the maximum value in this list.
Use Python's `max()` function. This is one of Python's
built-in functions,
Another one of these built-in functions is `round()`. It
takes two inputs: first, a number you want to round, and second, the precision
with which to round, so how many digits behind the decimal point you want to
keep.
But there's more. It's perfectly possible to call the
`round()` function with only one input, like this. This time, Python figured
out that you didn't specify the second input, and automatically chooses to
round the number to the closest integer.
0 comments:
Post a Comment