



"""simple docstring"""




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






def 						_SCREAMING_SNAKE_CASE							( UpperCamelCase     :	int    ):
  if not isinstance(UpperCamelCase		,				UpperCamelCase    ) or n < 1:
    return False

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






def 						_SCREAMING_SNAKE_CASE							( UpperCamelCase     :	int    ):
  if not isinstance(UpperCamelCase		,				UpperCamelCase    ) or n < 1:
    return False

  # Init a "histogram" of the digits
  A__											=							[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  A__											=							0
  A__											=							0
  A__											=							n
  while temp > 0:
    A__						,A__											=							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 						_SCREAMING_SNAKE_CASE							( UpperCamelCase     :	int    ):
  if not isinstance(UpperCamelCase		,				UpperCamelCase    ) or n < 1:
    return False
  A__											=							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 						_SCREAMING_SNAKE_CASE							( ):
  A__											=							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"""




def 						_SCREAMING_SNAKE_CASE							( UpperCamelCase     :	int		,				UpperCamelCase     :	int = 1000    ):
  if (not isinstance(UpperCamelCase		,				UpperCamelCase    )) or (digit_position <= 0):
    raise ValueError("""Digit position must be a positive integer"""    )
  elif (not isinstance(UpperCamelCase		,				UpperCamelCase    )) or (precision < 0):
    raise ValueError("""Precision must be a nonnegative integer"""    )

  # compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
  # accurate
  A__											=							(
      4 * _subsum(UpperCamelCase		,				1		,				UpperCamelCase    )
      - 2 * _subsum(UpperCamelCase		,				4		,				UpperCamelCase    )
      - _subsum(UpperCamelCase		,				5		,				UpperCamelCase    )
      - _subsum(UpperCamelCase		,				6		,				UpperCamelCase    )
  )

  # return the first hex digit of the fractional part of the result
  return hex(int((sum_result % 1) * 16    )    )[2:]






def 						_SCREAMING_SNAKE_CASE							( UpperCamelCase     :	int		,				UpperCamelCase     :	int		,				UpperCamelCase     :	int    ):
  A__											=							0.0
  for sum_index in range(digit_pos_to_extract + precision    ):
    A__											=							8 * sum_index + denominator_addend
    if sum_index < digit_pos_to_extract:
      # if the exponential term is an integer and we mod it by the denominator
      # before dividing, only the integer part of the sum will change;
      # the fractional part will not
      A__											=							pow(
          16		,				digit_pos_to_extract - 1 - sum_index		,				UpperCamelCase    )
    else:
      A__											=							pow(16		,				digit_pos_to_extract - 1 - sum_index    )
    total += exponential_term / denominator
  return total


if __name__ == "__main__":
      import doctest

      doctest.testmod()




