Numerical Functions
Learn about the different numerical functions available in Python.
Numbers
Here are some built-in functions on numbers:
-
abs(x)
returns the absolute value of a numberx
(or the magnitude of a complex number). -
bin(int)
returns a binary string representation ofint
. -
chr(int)
returns the character whose Unicode representation isint
. The inverse operation isord
. -
divmod(x, y)
returns the tuple (x // y
,x % y
) for integers. -
float(x)
converts a string or integerx
to a ...