Power of a number implementation - iterative, recursive and template.
Implement exponentiation for an integer base and exponent using exponentiation by squaring. Provide iterative and recursive approaches, and explain how a reusable generic or template-style implementation supports numeric types with multiplication and division.
Use def power(base, exponent):; return a numeric result. Define 0^0 as 1 and do not test negative exponents with base 0.
def power(base, exponent):