Search⌘ K
AI Features

Numerical Functions

Explore key Python numerical functions including absolute value, binary, hexadecimal conversions, and power calculations. Understand math module features like ceiling, floor, square root, and logarithms. Discover random module functions for generating random numbers and shuffling sequences to enhance your Python programming skills.

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 ...