UpperCamelCase__											=					'ABCDEFGHIJKLMNOPQRSTUVWXYZ'




def    lowerCAmelCase_ (     )     ->				None:







      '''simple docstring'''


      UpperCAmelCase__								=  input("Enter message: "							)
      UpperCAmelCase__								=  input("Enter key [alphanumeric]: "							)
      UpperCAmelCase__								=  input("Encrypt/Decrypt [e/d]: "							)

      if mode.lower().startswith("e"							):
            UpperCAmelCase__								=  "encrypt"
            UpperCAmelCase__								=  encrypt_message(__A,  __A							)
      elif mode.lower().startswith("d"							):
            UpperCAmelCase__								=  "decrypt"
            UpperCAmelCase__								=  decrypt_message(__A,  __A							)

      print(f"""\n{mode.title()}ed message:"""							)
      print(__A							)




def    lowerCAmelCase_ (     __A,  __A							)     ->				str:







      '''simple docstring'''


      return translate_message(__A,  __A,  "encrypt"							)




def    lowerCAmelCase_ (     __A,  __A							)     ->				str:







      '''simple docstring'''


      return translate_message(__A,  __A,  "decrypt"							)




def    lowerCAmelCase_ (     __A,  __A,  __A							)     ->				str:







      '''simple docstring'''


      UpperCAmelCase__								=  []
      UpperCAmelCase__								=  0
      UpperCAmelCase__								=  key.upper()

      for symbol in message:
            UpperCAmelCase__								=  LETTERS.find(symbol.upper()							)
            if num != -1:
                  if mode == "encrypt":
                        num += LETTERS.find(key[key_index]							)
                  elif mode == "decrypt":
                        num -= LETTERS.find(key[key_index]							)

                  num %= len(__A							)

                  if symbol.isupper():
                        translated.append(LETTERS[num]							)
                  elif symbol.islower():
                        translated.append(LETTERS[num].lower()							)

                  key_index += 1
                  if key_index == len(__A							):
                        UpperCAmelCase__								=  0
            else:
                  translated.append(__A							)
      return "".join(__A							)


if __name__ == "__main__":
      main()




import math
import random




def    lowerCAmelCase_ (     __A,  __A = False							)     ->				float:







      '''simple docstring'''


      if deriv:
            return value * (1 - value)
      return 1 / (1 + math.exp(-value							))


# Initial Value
UpperCamelCase__											=					0.0_2




def    lowerCAmelCase_ (     __A,  __A							)     ->				float:







      '''simple docstring'''


      UpperCAmelCase__								=  float(2 * (random.randint(1,  100							)) - 1							)

      for _ in range(__A							):
            # Forward propagation
            UpperCAmelCase__								=  sigmoid_function(INITIAL_VALUE * weight							)
            # How much did we miss?
            UpperCAmelCase__								=  (expected / 100) - layer_a
            # Error delta
            UpperCAmelCase__								=  layer_1_error * sigmoid_function(__A,  __A							)
            # Update weight
            weight += INITIAL_VALUE * layer_1_delta

      return layer_a * 100


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      UpperCamelCase__											=					int(input('Expected value: '))
      UpperCamelCase__											=					int(input('Number of propagations: '))
      print(forward_propagation(expected, number_propagations))



