let us know in detail about the python power operator.
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
- x=12**2
- print(x)
- 144
#2.write a python program to calculate the power of a number.
- x=1**2
- print(x)
- 1
No comments