Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 520 Bytes

File metadata and controls

13 lines (10 loc) · 520 Bytes

برنامه‌ای که عددی را خوانده، تشخیص می‌دهد عددی Armstrong است یا خیر⁉️

عددی Armstrong است که مجموع ارقام به توان تعداد ارقام برابر خود عدد باشد.


number = input()
aggregate = sum([int(i)**len(number) for i in number])

if number == aggregate:
    print("This number is an Armstrong number!")
else:
    print("This number isn't an Armstrong number!")