






'''simple docstring'''





from __future__ import annotations





def    _lowerCamelCase	(	__lowerCamelCase					)   -> Optional[Any]:

     '''simple docstring'''
     UpperCAmelCase__			:     Tuple										= 42
     UpperCAmelCase__			:     List[Any]										= list(UpperCamelCase__					)
     UpperCAmelCase__			,		UpperCAmelCase__			:     int										= _vector[:-1], int(_vector[-1]					)
     UpperCAmelCase__			:     Tuple										= [int(UpperCamelCase__					) for digit in __vector]

     vector.reverse()
     for i, digit in enumerate(UpperCamelCase__					):
          if i & 1 == 0:
               UpperCAmelCase__			:     Union[str, Any]										= digit * 2
               if doubled > 9:
                    doubled -= 9
               check_digit += doubled
          else:
               check_digit += digit

     return check_digit % 10 == 0


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      assert is_luhn("""79927398713""")
      assert not is_luhn("""79927398714""")














import random







class 							UpperCAmelCase_     :




     def __init__(							self  ,	_lowerCAmelCase  ,	_lowerCAmelCase		):
          UpperCAmelCase__			:     Union[str, Any]										= x
          UpperCAmelCase__			:     Union[str, Any]										= y




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




     @classmethod
     def      __UpperCAmelCase     (							cls		):
          return cls(x=random.random()  ,	y=random.random()		)





def    _lowerCamelCase	(	__lowerCamelCase					)   -> float:

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

     UpperCAmelCase__			:     Dict										= 0
     for _ in range(__lowerCamelCase					):
          UpperCAmelCase__			:     Union[str, Any]										= 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__		:       List[str]   							=							"""Please enter the desired number of Monte Carlo simulations: """
      SCREAMING_SNAKE_CASE__		:       int   							=							estimate_pi(int(input(prompt).strip()))
      print(f'''An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}''')






