Skip to content

Instantly share code, notes, and snippets.

@ysnerdem
Created January 17, 2018 23:30
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 ysnerdem/8d55d592ba93edb247608773148263c7 to your computer and use it in GitHub Desktop.
Save ysnerdem/8d55d592ba93edb247608773148263c7 to your computer and use it in GitHub Desktop.
while True:
num = input("Sayı giriniz:")
arm_factor = len(num)
sum = 0
if num == "q":
print("Sonlandırıldı")
break
else:
for i in num:
x = int(i)
sum += x**arm_factor
if sum == int(num):
print("Armstrong sayısı")
else:
print("Armstrong sayısı değil.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment