




def    snake_case(							__magic_name__					,						__magic_name__       )					->				Dict:





     '''simple docstring'''


     return base * power(__lowerCamelCase					,						(exponent - 1)       ) if exponent else 1


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

from math import factorial


def      UpperCamelCase   (       __lowerCamelCase	:					int							,   __lowerCamelCase	:					int							,   __lowerCamelCase	:					float       ):
       if successes > trials:
              raise ValueError("successes must be lower or equal to trials"       )
       if trials < 0 or successes < 0:
              raise ValueError("the function is defined for non-negative integers"       )
       if not isinstance(__lowerCamelCase							,   __lowerCamelCase       ) or not isinstance(__lowerCamelCase							,   __lowerCamelCase       ):
              raise ValueError("the function is defined for non-negative integers"       )
       if not 0 < prob < 1:
              raise ValueError("prob has to be in range of 1 - 0"       )
       snake_case			:  Tuple     							= (prob**successes) * ((1 - prob) ** (trials - successes))
       # Calculate the binomial coefficient: n! / k!(n-k)!
       snake_case			:  str     							= float(factorial(__lowerCamelCase       )       )
       coefficient /= factorial(__lowerCamelCase       ) * factorial(trials - successes       )
       return probability * coefficient


if __name__ == "__main__":
   from doctest import testmod

   testmod()
   print("""Probability of 2 successes out of 4 trails""")
   print("""with probability of 0.75 is:""", end=""" """)
   print(binomial_distribution(2, 4, 0.75))





