Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python Armstrong Number

number = 153
temp = number
add_sum = 0
while temp!=0:
    k = temp%10
    add_sum +=k*k*k
    temp = temp//10
if add_sum==number:
    print('Armstrong Number')
else:
    print('Not a Armstrong Number')
Source by www.scaler.com #
 
PREVIOUS NEXT
Tagged: #Python #Armstrong #Number
ADD COMMENT
Topic
Name
4+3 =