Skip to content

Instantly share code, notes, and snippets.

@AnnikaNoren
Created November 2, 2020 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnnikaNoren/7f493c6a9e18855ad6a4303a7bb9c791 to your computer and use it in GitHub Desktop.
Save AnnikaNoren/7f493c6a9e18855ad6a4303a7bb9c791 to your computer and use it in GitHub Desktop.
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