Do one of the following programming problems:
Power Function
Create a function called compute_power(base, exponent)
,
which
recieves two parameters: a floating point value representing the
base of the
power, and an integer representing the exponent. Your function
should
return a floating point value representing the result of raising the
base to
the specified exponent. Your function should not use the **
operator.
Recall that exponentiation is:
bn=b×b×…×b⏟n
Where there are n occurances of b in the terms on the right hand side of the equation.
Geometric Series
Create a function called geometic_series(num_terms)
that computes the sum of the specified number of terms of the series:
1+12+14+18+116+…