




import sys
import turtle






def    snake_case(							__magic_name__					,						__magic_name__       )					->				List[Any]:





     '''simple docstring'''


     return (pa[0] + pa[0]) / 2, (pa[1] + pa[1]) / 2






def    snake_case(							__magic_name__					,						__magic_name__					,						__magic_name__					,						__magic_name__					,						)					->				str:





     '''simple docstring'''


     my_pen.up()
     my_pen.goto(vertexa[0]					,						vertexa[1]       )
     my_pen.down()
     my_pen.goto(vertexa[0]					,						vertexa[1]       )
     my_pen.goto(vertexa[0]					,						vertexa[1]       )
     my_pen.goto(vertexa[0]					,						vertexa[1]       )

     if depth == 0:
          return

     triangle(__lowerCamelCase					,						get_mid(__lowerCamelCase					,						__lowerCamelCase       )					,						get_mid(__lowerCamelCase					,						__lowerCamelCase       )					,						depth - 1       )
     triangle(__lowerCamelCase					,						get_mid(__lowerCamelCase					,						__lowerCamelCase       )					,						get_mid(__lowerCamelCase					,						__lowerCamelCase       )					,						depth - 1       )
     triangle(__lowerCamelCase					,						get_mid(__lowerCamelCase					,						__lowerCamelCase       )					,						get_mid(__lowerCamelCase					,						__lowerCamelCase       )					,						depth - 1       )


if __name__ == "__main__":
 if len(sys.argv) != 2:
  raise ValueError(
      'Correct format for using this script: '
      'python fractals.py <int:depth_for_fractal>'
  )
 lowerCAmelCase_						 =					turtle.Turtle()
 my_pen.ht()
 my_pen.speed(5)
 my_pen.pencolor('red')

 lowerCAmelCase_						 =					[(-1_75, -1_25), (0, 1_75), (1_75, -1_25)]  # vertices of triangle
 triangle(vertices[0], vertices[1], vertices[2], int(sys.argv[1]))

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))





