



A__  :  Union[str, Any]       = (1, 153, 370, 371, 1634, 2467_8051, 115_1322_1901_8763_9925_6509_5597_9739_7152_2401)
A__  :  tuple       = (-153, -1, 0, 1.2, 200, "A", [], {}, None)


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

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


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

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










A__  :  str       = 1000


def       UpperCamelCase(  __UpperCamelCase							:		float			):
		return x * x


def       UpperCamelCase(  __UpperCamelCase							:		Optional[int]					,__UpperCamelCase							:		float					,__UpperCamelCase							:		float					,__UpperCamelCase							:		int = 4			):
		assert callable(
		    __UpperCamelCase			), f"""the function(object) passed should be callable your input : {function}"""
		assert isinstance(__UpperCamelCase					,(float, int)			), f"""a should be float or integer your input : {a}"""
		assert isinstance(function(__UpperCamelCase			)					,(float, int)			), (
		    "the function should return integer or float return type of your function, "
		    f"""{type(__UpperCamelCase			)}"""
		)
		assert isinstance(__UpperCamelCase					,(float, int)			), f"""b should be float or integer your input : {b}"""
		assert (
		    isinstance(__UpperCamelCase					,__UpperCamelCase			) and precision > 0
		), f"""precision should be positive integer your input : {precision}"""

		# just applying the formula of simpson for approximate integration written in
		# mentioned article in first comment of this file and above this function

		lowerCAmelCase_      :					List[str]     =			(b - a) / N_STEPS
		lowerCAmelCase_      :					str     =			function(__UpperCamelCase			) + function(__UpperCamelCase			)

		for i in range(1					,__UpperCamelCase			):
				lowerCAmelCase_      :					Optional[Any]     =			a + h * i
				result += function(__UpperCamelCase			) * (4 if i % 2 else 2)

		result *= h / 3
		return round(__UpperCamelCase					,__UpperCamelCase			)


if __name__ == "__main__":
						import doctest

						doctest.testmod()





