Q. How is built-in function pow() function different from function math.pow() ? Explain with an example.


Answer:-

pow(x,y[,z]):- It means x raised to the power y) if z is provided, then: (x**y ) % z

Example:-
>>> pow(5,2,4)
1

math.pow(x,y) :- It means x raised to the power y

Example:-
>>> math.pow(3,2)
9.0

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post