Created
March 23, 2018 02:41
-
-
Save warpgate3/c6cc494123ec21c296a12f0c4ae4a995 to your computer and use it in GitHub Desktop.
find self number under 5000
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
def generateNum(inputNumber): | |
sumResult = 0 | |
for n in str(inputNumber): | |
sumResult = sumResult + int(n) | |
return sumResult + inputNumber | |
ORIGIN = set(range(1,5001)) | |
FILTER = set([generateNum(n) for n in range(1, 5001)]) | |
print(sum(ORIGIN - FILTER)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment