import random







class        UpperCAmelCase_					:




    def __init__(       self	: Optional[int]   ,   lowerCAmelCase	: float   ,   lowerCAmelCase	: float )						->			None:
      a__  		=  x
      a__  		=  y




    def     __lowerCamelCase			(       self	: List[Any] )						->			bool:
      return (self.x**2 + self.y**2) <= 1




    @classmethod
    def     __lowerCamelCase			(       cls	: Tuple )						->			List[Any]:
      return cls(x=random.random()   ,   y=random.random() )

def 					__lowercase						(    lowerCamelCase__       )					->float:

  '''simple docstring'''




  if number_of_simulations < 1:
    raise ValueError("At least one simulation is necessary to estimate PI."       )

  a__  		=  0
  for _ in range(lowerCamelCase__       ):
    a__  		=  Point.random_unit_square()

    if random_point.is_in_unit_circle():
      number_in_unit_circle += 1

  return 4 * number_in_unit_circle / number_of_simulations


if __name__ == "__main__":
     # import doctest

     # doctest.testmod()
     from math import pi

     _SCREAMING_SNAKE_CASE     =     """Please enter the desired number of Monte Carlo simulations: """
     _SCREAMING_SNAKE_CASE     =     estimate_pi(int(input(prompt).strip()))
     print(F"""An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}""")


def 					__lowercase						(    lowerCamelCase__       )					->int:

  '''simple docstring'''




  if not isinstance(lowerCamelCase__			,					lowerCamelCase__       ):
    raise ValueError("double_factorial() only accepts integral values"       )
  if n < 0:
    raise ValueError("double_factorial() not defined for negative values"       )
  return 1 if n <= 1 else n * double_factorial(n - 2       )


if __name__ == "__main__":
     import doctest

     doctest.testmod()

