pow()

Alex alex at somewhere.round.here
Wed Jul 21 16:08:40 EDT 1999


>>> pow (20,5,3)
2
>>> pow(20,5)%3
2
>>> pow(20,5)-(pow(20,5)/3)*3
2

It returns the remainder you get when you divide by the third argument
the power specified by the first two arguments.  You can compute the
power faster if you know that you're only going to need that remainder
in the end.

Alex.




More information about the Python-list mailing list