



def      _lowerCAmelCase			(   __lowerCAmelCase    ,    __lowerCAmelCase )  ->   float:


				"""simple docstring"""

				if discount_rate < 0:
								raise ValueError('''Discount rate cannot be negative''' )
				if not cash_flows:
								raise ValueError('''Cash flows list cannot be empty''' )
				snake_case__      : Tuple							=      sum(
				    cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(UpperCamelCase__ ) )
				return round(UpperCamelCase__    ,    ndigits=2 )


if __name__ == "__main__":
				import doctest

				doctest.testmod()


'''simple docstring'''




def __lowerCAmelCase					(				UpperCamelCase__							,    UpperCamelCase__							)      ->       float:
    return base * power(UpperCamelCase__							,    (exponent - 1)							) if exponent else 1


if __name__ == "__main__":
  print("Raise base to the power of exponent using recursion...")
  __UpperCAmelCase					=int(input("Enter the base: ").strip())
  __UpperCAmelCase					=int(input("Enter the exponent: ").strip())
  __UpperCAmelCase					=power(base, abs(exponent))
  if exponent < 0:  # power() does not properly deal w/ negative exponents
    __UpperCAmelCase					=1 / result
  print(f'{base} to the power of {exponent} is {result}')
