Created
June 30, 2018 20:19
-
-
Save matinkaboli/e07160db3d938f9d56f782ab909bb69d to your computer and use it in GitHub Desktop.
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 digitPower(num): | |
numString = str(num) | |
su = 0 | |
for j in range(0, len(numString)): | |
su += int(numString[j]) ** 5 | |
if num == su: | |
return True | |
return False | |
s = 0; | |
for i in range(2, 100000000): | |
if digitPower(i): | |
s += i | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not the best way. Don't use this.
It will never stop 😄