Your question is Armstrong Number Program. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A validation utility in Capgemini Engineering must identify whether a non-negative integer has the Armstrong property. Write a function that returns True when the number equals the sum of its digits, with every digit raised to the total number of digits, and returns False otherwise.
Given an integer number, return a Boolean. For a number with k decimal digits d1, d2, ..., dk, it is an Armstrong number if:
number = d1^k + d2^k + ... + dk^k
Treat 0 as a one-digit Armstrong number because 0^1 = 0. Do not convert the number to a string in the primary solution. Extract digits using arithmetic operations such as modulo and integer division.
def is_armstrong(number):