Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

armstrong number function

def is_armstrong_number(number: int)-> bool:
    arm = str(number)
    lenght = len(arm)
    sum = 0
    for digit in arm:
        sum += int(digit)**lenght
    return sum == number
Source by exercism.io #
 
PREVIOUS NEXT
Tagged: #armstrong #number #function
ADD COMMENT
Topic
Name
3+5 =