Posted by:
instanceofjava
Posted date:
7:00 PM
/
let us know in detail about the python power operator.
Power operator is one of the arithmetic operator .. In python the power operator can be used to calculate the power of a number or exponential . The power operator in python is denoted by " ** " symbol. It always returns the float types values only. The power operator is having the second highest priority in the operator precedence as first priority goes to parenthesis. The power operator can be calculated in two ways :
1. using **
2. using pow()function.
- For two arguments we write the power as (a,b) i.e a to the power of b
- For three it is written as (a,b,c) i.e x to the power of b, modulus c.
- The syntax for 3 arguments is (a,b,c).
Now let us go to some practical examples:
#1.write a python program to calculate the power of a number
#2.write a python program to calculate the power of a number.