pow()
pow(x,y,z) : x to the power of y with modulus z
x | Number the base |
y | Number the exponent. |
z | (optional) number used to get Modulus ( % ) |
Return the number .
Examples
print(pow(2,3)) # 8
This is same as 23 , output is 8
Using z to get modulus (optional)
To above output we can apply modulus %
print(pow(2,3,3)) # 2
Using float
print(pow(2.3,3)) # 12.166999999999998
« max()
Bitwise operators using bin() »
int()
float()
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com