# An Armstrong number of three digits is an integer that the sum
# of the cubes of its digits is equal to the number itself
# 371 is an Armstrong number: 3**3 + 7**3 + 1**3 = 371
n = 371
summ = 0
tmp = n
while n != 0:
reminder = n % 10
n //= 10
summ += reminder * reminder * reminder
if summ == tmp:
print(tmp, 'is an Armstrong number')
else:
print(tmp, 'is not an Armstrong number')
'''
run:
371 is an Armstrong number
'''