"""simple docstring"""




import random





class 			__snake_case  :




					def __init__(       self   ,	__UpperCamelCase   ,	__UpperCamelCase		)					->  Tuple:



									'''simple docstring'''







									snake_case__ :     Union[str, Any] 							=				x
									snake_case__ :     int 							=				y




					def       __a      (       self		)					->  Any:



									'''simple docstring'''







									return (self.x**2 + self.y**2) <= 1




					@classmethod
					def       __a      (       cls		)					->  Dict:



									'''simple docstring'''







									return cls(x=random.random()   ,	y=random.random()		)




def 			UpperCamelCase__						(    A__   )       -> float:

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

				snake_case__ :     List[str] 							=				0
				for _ in range(__lowercase   ):
								snake_case__ :     int 							=				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

				lowerCAmelCase__					:       Union[str, Any]		=       "Please enter the desired number of Monte Carlo simulations: "
				lowerCAmelCase__					:       List[str]		=       estimate_pi(int(input(prompt).strip()))
				print(F'''An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}''')



def 			UpperCamelCase__						(    A__   )       -> int:
				if number != int(A__   ):
								raise ValueError('factorial() only accepts integral values'   )
				if number < 0:
								raise ValueError('factorial() not defined for negative values'   )
				snake_case__ :     Optional[Any] 							=				1
				for i in range(1      ,			number + 1   ):
								value *= i
				return value
def 			UpperCamelCase__						(    A__   )       -> int:
				if not isinstance(A__      ,			A__   ):
								raise ValueError('factorial() only accepts integral values'   )
				if n < 0:
								raise ValueError('factorial() not defined for negative values'   )
				return 1 if n == 0 or n == 1 else n * factorial(n - 1   )


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				lowerCAmelCase__					:       Any		=       int(input('''Enter a positive integer: ''').strip() or 0)
				print(F'''factorial{n} is {factorial(n)}''')


