





'''simple docstring'''

lowercase_         =			(1, 153, 370, 371, 1_634, 24_678_051, 115_132_219_018_763_992_565_095_597_973_971_522_401)
lowercase_         =			(-153, -1, 0, 1.2, 200, "A", [], {}, None)





def lowerCamelCase						(					__lowerCamelCase			:   int   )						->bool:
    if not isinstance(__lowerCamelCase ,	__lowerCamelCase   ) or n < 1:
        return False

    # Initialization of sum and number of digits.
    _SCREAMING_SNAKE_CASE     =      0
    _SCREAMING_SNAKE_CASE     =      0
    _SCREAMING_SNAKE_CASE     =      n
    # Calculation of digits of the number
    while temp > 0:
        number_of_digits += 1
        temp //= 10
    # Dividing number into separate digits and find Armstrong number
    _SCREAMING_SNAKE_CASE     =      n
    while temp > 0:
        _SCREAMING_SNAKE_CASE     =      temp % 10
        total += rem**number_of_digits
        temp //= 10
    return n == total





def lowerCamelCase						(					__lowerCamelCase			:   int   )						->bool:
    if not isinstance(__lowerCamelCase ,	__lowerCamelCase   ) or n < 1:
        return False

    # Init a "histogram" of the digits
    _SCREAMING_SNAKE_CASE     =      [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    _SCREAMING_SNAKE_CASE     =      0
    _SCREAMING_SNAKE_CASE     =      0
    _SCREAMING_SNAKE_CASE     =      n
    while temp > 0:
        _SCREAMING_SNAKE_CASE    ,	_SCREAMING_SNAKE_CASE     =      divmod(__lowerCamelCase ,	10   )
        digit_histogram[rem] += 1
        digit_total += 1

    for cnt, i in zip(__lowerCamelCase ,	range(len(__lowerCamelCase   )   )   ):
        total += cnt * i**digit_total

    return n == total





def lowerCamelCase						(					__lowerCamelCase			:   int   )						->bool:
    if not isinstance(__lowerCamelCase ,	__lowerCamelCase   ) or n < 1:
        return False
    _SCREAMING_SNAKE_CASE     =      len(str(__lowerCamelCase   )   )  # the power that all digits will be raised to
    # check if sum of each digit multiplied expo times is equal to number
    return n == sum(int(__lowerCamelCase   ) ** expo for i in str(__lowerCamelCase   )   )





def lowerCamelCase						(					)						->List[str]:
    _SCREAMING_SNAKE_CASE     =      int(input("""Enter an integer to see if it is an Armstrong number: """   ).strip()   )
    print(F'{num} is {"" if armstrong_number(__lowerCamelCase   ) else "not "}an Armstrong number.'   )
    print(F'{num} is {"" if narcissistic_number(__lowerCamelCase   ) else "not "}an Armstrong number.'   )
    print(F'{num} is {"" if pluperfect_number(__lowerCamelCase   ) else "not "}an Armstrong number.'   )


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()










'''simple docstring'''

import os
import sys
import time

from . import transposition_cipher as trans_cipher





def lowerCamelCase						(					)						->None:
    _SCREAMING_SNAKE_CASE     =      """Prehistoric Men.txt"""
    _SCREAMING_SNAKE_CASE     =      """Output.txt"""
    _SCREAMING_SNAKE_CASE     =      int(input("""Enter key: """   )   )
    _SCREAMING_SNAKE_CASE     =      input("""Encrypt/Decrypt [e/d]: """   )

    if not os.path.exists(__lowerCamelCase   ):
        print(F'File {input_file} does not exist. Quitting...'   )
        sys.exit()
    if os.path.exists(__lowerCamelCase   ):
        print(F'Overwrite {output_file}? [y/n]'   )
        _SCREAMING_SNAKE_CASE     =      input("""> """   )
        if not response.lower().startswith("""y"""   ):
            sys.exit()

    _SCREAMING_SNAKE_CASE     =      time.time()
    if mode.lower().startswith("""e"""   ):
        with open(__lowerCamelCase   ) as f:
            _SCREAMING_SNAKE_CASE     =      f.read()
        _SCREAMING_SNAKE_CASE     =      trans_cipher.encrypt_message(__lowerCamelCase ,	__lowerCamelCase   )
    elif mode.lower().startswith("""d"""   ):
        with open(__lowerCamelCase   ) as f:
            _SCREAMING_SNAKE_CASE     =      f.read()
        _SCREAMING_SNAKE_CASE     =      trans_cipher.decrypt_message(__lowerCamelCase ,	__lowerCamelCase   )

    with open(__lowerCamelCase ,	"""w"""   ) as output_obj:
        output_obj.write(__lowerCamelCase   )

    _SCREAMING_SNAKE_CASE     =      round(time.time() - start_time ,	2   )
    print(("""Done (""", total_time, """seconds )""")   )


if __name__ == "__main__":
      main()



