April 2024
Beginner to intermediate
500 pages
24h 20m
English
Table B.13 summarizes the main functions from the math module used in this text. To use these functions, first import math.
Table B.13 Some Math Functions and Constants
| Name | Use | Explanation |
|---|---|---|
| dist | math.dist(p1, p2) | Returns the Euclidean distance between two points, p1 and p2, specified as a tuple. |
| sqrt | math.sqrt(x) | Returns the square root of x. |
| log10 | math.log10(x) | Returns the base 10 logarithm of x. |
| log2 | math.log2(x) | Returns the base 2 logarithm of x. |
| pi | math.pi | Evaluates to 3.141592653589793. |
| e | math.e | Evaluates to 2.718281828459045. |
Table B.14 summarizes the main functions from the random module used in this text. To use these functions, first import random.
Table ...
Read now
Unlock full access