Power operation is an applied discipline of Gauguin mathematics, which is a mathematical operation about power. You multiply the same base, you keep the same base, you add the exponents. The same base divided by the power, the base does not change, the exponent subtracts. The power, the base stays the same, you multiply the exponents. Suitable for precise computing. The computer, as a means of accurate calculation, contains a great deal of power operations. There are built-in functions in Python called the POw function that represent exponents.

1. Pow () function

A built-in function in Python that evaluates and returns the value of x to the y.

2, grammar,

pow(x, y, z)

Copy the code

3, parameters,

X – Numeric expression.

Y – Numeric expression.

Z – Numeric expression.

4. Return value

Return the value of x y (x to the y).

5. Pow () function interpretation

Pow (x,y) : denotes x to the y power.

Pow (2, 4) 16Copy the code

Pow (x,y,z) : represents the remainder of x to the y power divided by z.

Pow (2, four, five) 1Copy the code

Example: pow() returns the power of two numeric values

> > > pow (2, 3) > > > 2 * * 3 > > > pow,3,5 (2) > > > pow (2, 3) % 5Copy the code

This is the pow function in Python, which is basically the multiplication of powers in mathematics, and is an integral part of the operation. Quick master oh ~

This article is from the SDK community: www.sdk.cn