Check Armstrong Number

num = int(input("Enter a number: ")) sum = 0 temp = num while temp > 0: digit = temp % 10 sum += digit ** 3 temp //= 10 if num == sum: print(num,"is an Armstrong number") else: print(num,"is not an Armstrong number")

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.