Last active
August 29, 2015 14:04
-
-
Save nathanleclaire/0ea0672dee3b2458c2ad to your computer and use it in GitHub Desktop.
print all numbers < 1 million that have digits which sum to 42
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 len([n for n in range(0, 1000000) if sum(int(i) for i in str(n)) == 42]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment