...

/

Numerical Functions

Numerical Functions

Learn about the different numerical functions available in Python.

We'll cover the following...

Numbers

Here are some built-in functions on numbers:

  • abs(x) returns the absolute value of a number x (or the magnitude of a complex number).

  • bin(int) returns a binary string representation of int.

  • chr(int) returns the character whose Unicode representation is int. The inverse operation is ord.

  • divmod(x, y) returns the tuple (x // yx % y) for integers.

  • float(x) converts a string or integer x to a ...