MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / main

Function main

maths/special_numbers/armstrong_numbers.py:85–92  ·  view source on GitHub ↗

Request that user input an integer and tell them if it is Armstrong number.

()

Source from the content-addressed store, hash-verified

83
84
85def main():
86 """
87 Request that user input an integer and tell them if it is Armstrong number.
88 """
89 num = int(input("Enter an integer to see if it is an Armstrong number: ").strip())
90 print(f"{num} is {'' if armstrong_number(num) else 'not '}an Armstrong number.")
91 print(f"{num} is {'' if narcissistic_number(num) else 'not '}an Armstrong number.")
92 print(f"{num} is {'' if pluperfect_number(num) else 'not '}an Armstrong number.")
93
94
95if __name__ == "__main__":

Callers 1

Calls 3

armstrong_numberFunction · 0.85
narcissistic_numberFunction · 0.85
pluperfect_numberFunction · 0.85

Tested by

no test coverage detected