Created
October 7, 2018 02:14
-
-
Save joshdabosh/1eafffb49aba5475728f71f83ecdefcd to your computer and use it in GitHub Desktop.
Armstrong number generator for numbers between any range of numbers (100 to 999 for example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(*[num for num in range(100, 1000) if int(sum([int(a)**3 for _, a in enumerate(str(num))])) == int(num)], sep=", ") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment