The following is a list of the most common numerical types that Python supports:
- int: These are sometimes called integers, and they are positive or negative whole numbers with no decimal point (for example, 11).
- long (long integers): These are integers of unlimited size, written like integers and followed by an uppercase or lowercase L (for example, 788739888999L).
- float (floating points): These represent real numbers, and are written with a decimal point (99.9999). Floats are sometimes used in scientific notation, with E or e indicating the power of 10 (2e2 = 2 x 102).
- To get the maximum or minimum of two numbers, do the following:
num1 = max(2,8)num2=min(2,8)
- To generate a random number from a range, do the following:
# Generate ...