0

What is the power steatment in pyton?

21st Dec 2018, 8:24 AM
Reza.ES
Reza.ES - avatar
3 Answers
+ 9
You mean by power function in math module ??? If yes, then you can use it like this : from math import * pow(2,5)
21st Dec 2018, 8:35 AM
Nova
Nova - avatar
+ 4
Hi morteza I don't think there's a power statement in Python. However, there is a pow() function. pow(x, y) returns x to the power of y. So pow(2, 3) = 2^3 = 2*2*2=8. pow(x, y) is equivalent to x**y. Hope that helps. :)
21st Dec 2018, 8:34 AM
Kishalaya Saha
Kishalaya Saha - avatar
+ 2
Thanks a lot
21st Dec 2018, 8:51 AM
Reza.ES
Reza.ES - avatar