Answer to Question #230733 in Python for Pandu

Question #230733
3 digit Armstrong number
1
Expert's answer
2021-08-30T01:35:51-0400
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS