n = input('Enter number here: ')
s = int(n[0])**3+int(n[1])**3+int(n[2])**3
if s == int(n):
print(n, 'is a 3 digit armstrong number')
else:
print(n, 'isn\'t a 3 digit armstrong number')
Enter number here: 153
153 is a 3 digit armstrong number
Enter number here: 155
155 isn't a 3 digit armstrong number
Comments
Leave a comment