Created
November 2, 2020 18:45
-
-
Save AnnikaNoren/7f493c6a9e18855ad6a4303a7bb9c791 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 disarm(num): | |
temp = 0 | |
num_list = [int(x) for x in str(num)] | |
for i, j in enumerate(num_list): | |
temp += j ** (i+1) | |
if temp == num: | |
print("The number", num, "is a disarmuim") | |
else: | |
print("Sorry, the number ", num, "is not a disarmium") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment