Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Armstrong Numbers // range 1-1000
for i in range(1, 1000):
t = i
u = len(str(i))
x = 0
while u != 0 :
b = i/pow(10,u-1)
i = i%pow(10,u-1)
u=u-1
x = x + pow(b,3)
i = t
if i == x:
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment