Skip to content

Instantly share code, notes, and snippets.

@joshdabosh
Created October 7, 2018 02:14
Show Gist options
  • Save joshdabosh/1eafffb49aba5475728f71f83ecdefcd to your computer and use it in GitHub Desktop.
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)
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