

'''simple docstring'''

from __future__ import annotations





class 							_snake_case :
   def __init__( self			:      Dict     ,SCREAMING_SNAKE_CASE__			:      int = 0							):
     SCREAMING_SNAKE_CASE:Tuple						      =					key
   def     __UpperCamelCase						( self			:      Optional[int]     ,SCREAMING_SNAKE_CASE__			:      str     ,SCREAMING_SNAKE_CASE__			:      int							):
     assert isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							) and isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)

     SCREAMING_SNAKE_CASE:int						      =					key or self.__key or 1

     # make sure key is an appropriate size
     key %= 255

     return [chr(ord(SCREAMING_SNAKE_CASE__							) ^ key							) for ch in content]
   def     __UpperCamelCase						( self			:      Union[str, Any]     ,SCREAMING_SNAKE_CASE__			:      str     ,SCREAMING_SNAKE_CASE__			:      int							):
     assert isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							) and isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)

     SCREAMING_SNAKE_CASE:Any						      =					key or self.__key or 1

     # make sure key is an appropriate size
     key %= 255

     return [chr(ord(SCREAMING_SNAKE_CASE__							) ^ key							) for ch in content]
   def     __UpperCamelCase						( self			:      List[str]     ,SCREAMING_SNAKE_CASE__			:      str     ,SCREAMING_SNAKE_CASE__			:      int = 0							):
     assert isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							) and isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)

     SCREAMING_SNAKE_CASE:Tuple						      =					key or self.__key or 1

     # make sure key can be any size
     while key > 255:
       key -= 255

     # This will be returned
     SCREAMING_SNAKE_CASE:str						      =					""

     for ch in content:
       ans += chr(ord(SCREAMING_SNAKE_CASE__							) ^ key							)

     return ans
   def     __UpperCamelCase						( self			:      List[str]     ,SCREAMING_SNAKE_CASE__			:      str     ,SCREAMING_SNAKE_CASE__			:      int = 0							):
     assert isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							) and isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)

     SCREAMING_SNAKE_CASE:Dict						      =					key or self.__key or 1

     # make sure key can be any size
     while key > 255:
       key -= 255

     # This will be returned
     SCREAMING_SNAKE_CASE:Tuple						      =					""

     for ch in content:
       ans += chr(ord(SCREAMING_SNAKE_CASE__							) ^ key							)

     return ans
   def     __UpperCamelCase						( self			:      str     ,SCREAMING_SNAKE_CASE__			:      str     ,SCREAMING_SNAKE_CASE__			:      int = 0							):
     assert isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							) and isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)

     try:
       with open(SCREAMING_SNAKE_CASE__							) as fin, open("encrypt.out"     ,"w+"							) as fout:
         # actual encrypt-process
         for line in fin:
           fout.write(self.encrypt_string(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)							)

     except OSError:
       return False

     return True







   def     __UpperCamelCase						( self			:      int     ,SCREAMING_SNAKE_CASE__			:      str     ,SCREAMING_SNAKE_CASE__			:      int							):
     assert isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							) and isinstance(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)

     try:
       with open(SCREAMING_SNAKE_CASE__							) as fin, open("decrypt.out"     ,"w+"							) as fout:
         # actual encrypt-process
         for line in fin:
           fout.write(self.decrypt_string(SCREAMING_SNAKE_CASE__     ,SCREAMING_SNAKE_CASE__							)							)

     except OSError:
       return False

     return True


# Tests
# crypt = XORCipher()
# key = 67

# # test encrypt
# print(crypt.encrypt("hallo welt",key))
# # test decrypt
# print(crypt.decrypt(crypt.encrypt("hallo welt",key), key))

# # test encrypt_string
# print(crypt.encrypt_string("hallo welt",key))

# # test decrypt_string
# print(crypt.decrypt_string(crypt.encrypt_string("hallo welt",key),key))

# if (crypt.encrypt_file("test.txt",key)):
#       print("encrypt successful")
# else:
#       print("encrypt unsuccessful")

# if (crypt.decrypt_file("encrypt.out",key)):
#       print("decrypt successful")
# else:
#       print("decrypt unsuccessful")









'''simple docstring'''

from math import factorial





def    A_  ( snake_case      ,       snake_case ):

  # If either of the conditions are true, the function is being asked
  # to calculate a factorial of a negative number, which is not possible
  if n < k or k < 0:
    raise ValueError("Please enter positive integers for n and k where n >= k" )
  return factorial(snake_case ) // (factorial(snake_case ) * factorial(n - k ))


if __name__ == "__main__":
    print(
        "The number of five-card hands possible from a standard",
        f'''fifty-two card deck is: {combinations(52, 5)}\n''',
    )

    print(
        "If a class of 40 students must be arranged into groups of",
        f'''4 for group projects, there are {combinations(40, 4)} ways''',
        "to arrange them.\n",
    )

    print(
        "If 10 teams are competing in a Formula One race, there",
        f'''are {combinations(10, 3)} ways that first, second and''',
        "third place can be awarded.",
    )






