



'''simple docstring'''





_UpperCamelCase							    =						(1, 153, 370, 371, 1634, 24678051, 115132219018763992565095597973971522401)
_UpperCamelCase							    =						(-153, -1, 0, 1.2, 200, "A", [], {}, None)

def 	a_					(							_lowerCAmelCase	)				->				bool:



  if not isinstance(UpperCamelCase_	,UpperCamelCase_	) or n < 1:
    return False

  # Initialization of sum and number of digits.
  __lowerCamelCase	:	Optional[Any]   	=			0
  __lowerCamelCase	:	Optional[Any]   	=			0
  __lowerCamelCase	:	Any   	=			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
  __lowerCamelCase	:	Any   	=			n
  while temp > 0:
    __lowerCamelCase	:	str   	=			temp % 10
    total += rem**number_of_digits
    temp //= 10
  return n == total

def 	a_					(							_lowerCAmelCase	)				->				bool:



  if not isinstance(UpperCamelCase_	,UpperCamelCase_	) or n < 1:
    return False

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

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

  return n == total

def 	a_					(							_lowerCAmelCase	)				->				bool:



  if not isinstance(UpperCamelCase_	,UpperCamelCase_	) or n < 1:
    return False
  __lowerCamelCase	:	List[str]   	=			len(str(UpperCamelCase_	)	)  # 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(UpperCamelCase_	) ** expo for i in str(UpperCamelCase_	)	)

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


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()










'''simple docstring'''





import math
from timeit import timeit

def 	a_					(							_lowerCAmelCase	)				->				int:
  __lowerCamelCase	:	int   	=			0
  __lowerCamelCase	:	Optional[int]   	=			abs(_lowerCAmelCase	)
  while True:
    __lowerCamelCase	:	List[str]   	=			n // 10
    digits += 1
    if n == 0:
      break
  return digits

def 	a_					(							_lowerCAmelCase	)				->				int:
  return 1 if n == 0 else math.floor(math.log(abs(_lowerCAmelCase	)	,10	) + 1	)

def 	a_					(							_lowerCAmelCase	)				->				int:
  return len(str(abs(_lowerCAmelCase	)	)	)

def 	a_					(							)				->				None:
  from collections.abc import Callable

  def benchmark_a_function(_lowerCAmelCase	,_lowerCAmelCase	) -> None:
    __lowerCamelCase	:	Any   	=			F'{func.__name__}({value})'
    __lowerCamelCase	:	int   	=			timeit(F'__main__.{call}'	,setup='import __main__'	)
    print(F'{call}: {func(_lowerCAmelCase	)} -- {timing} seconds'	)

  for value in (262144, 1125899906842624, 1267650600228229401496703205376):
    for func in (num_digits, num_digits_fast, num_digits_faster):
      benchmark_a_function(_lowerCAmelCase	,_lowerCAmelCase	)
    print()


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()






