



'''simple docstring'''





from __future__ import annotations

from string import ascii_letters

def 	a_					(							_lowerCAmelCase	,_lowerCAmelCase	,_lowerCAmelCase = None	)				->				str:
  __lowerCamelCase	:	str   	=			alphabet or ascii_letters

  # The final result string
  __lowerCamelCase	:	Union[str, Any]   	=			''

  for character in input_string:
    if character not in alpha:
      # Append without encryption if character is not in the alphabet
      result += character
    else:
      # Get the index of the new key and make sure it isn't too large
      __lowerCamelCase	:	Tuple   	=			(alpha.index(_lowerCAmelCase	) + key) % len(_lowerCAmelCase	)

      # Append the encoded character to the alphabet
      result += alpha[new_key]

  return result

def 	a_					(							_lowerCAmelCase	,_lowerCAmelCase	,_lowerCAmelCase = None	)				->				str:
  key *= -1

  return encrypt(_lowerCAmelCase	,_lowerCAmelCase	,_lowerCAmelCase	)

def 	a_					(							_lowerCAmelCase	,_lowerCAmelCase = None	)				->				dict[int, str]:
  __lowerCamelCase	:	str   	=			alphabet or ascii_letters

  # To store data on all the combinations
  __lowerCamelCase	:	List[str]   	=			{}

  # Cycle through each combination
  for key in range(1	,len(_lowerCAmelCase	) + 1	):
    # Decrypt the message and store the result in the data
    __lowerCamelCase	:	Optional[int]   	=			decrypt(_lowerCAmelCase	,_lowerCAmelCase	,_lowerCAmelCase	)

  return brute_force_data


if __name__ == "__main__":
   while True:
      print(f'''\n{"-" * 10}\n Menu\n{"-" * 10}''')
      print(*['1.Encrypt', '2.Decrypt', '3.BruteForce', '4.Quit'], sep='\n')

      # get user input
      _UpperCamelCase							    =						input('\nWhat would you like to do?: ').strip() or '4'

      # run functions based on what the user chose
      if choice not in ("1", "2", "3", "4"):
         print('Invalid choice, please enter a valid choice')
      elif choice == "1":
         _UpperCamelCase							    =						input('Please enter the string to be encrypted: ')
         _UpperCamelCase							    =						int(input('Please enter off-set: ').strip())

         print(encrypt(input_string, key))
      elif choice == "2":
         _UpperCamelCase							    =						input('Please enter the string to be decrypted: ')
         _UpperCamelCase							    =						int(input('Please enter off-set: ').strip())

         print(decrypt(input_string, key))
      elif choice == "3":
         _UpperCamelCase							    =						input('Please enter the string to be decrypted: ')
         _UpperCamelCase							    =						brute_force(input_string)

         for key, value in brute_force_data.items():
            print(f'''Key: {key} | Message: {value}''')

      elif choice == "4":
         print('Goodbye.')
         break











'''simple docstring'''





import random






class  lowerCamelCase_   :
  """simple docstring"""




  def __init__(			self				:     Union[str, Any]      ,     _a				:     float      ,     _a				:     float       ) -> None:
    __lowerCamelCase	:	Optional[int]   	=			x
    __lowerCamelCase	:	Union[str, Any]   	=			y




  def 						_lowercase					(			self				:     Tuple       ) -> bool:
    return (self.x**2 + self.y**2) <= 1




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




def 	a_					(							_lowerCAmelCase	)				->				float:
  if number_of_simulations < 1:
    raise ValueError('At least one simulation is necessary to estimate PI.'	)

  __lowerCamelCase	:	Optional[int]   	=			0
  for _ in range(_lowerCAmelCase	):
    __lowerCamelCase	:	Dict   	=			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

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






