def isArmstrongNumber(n):
a = []
t = n
while t > 0:
a.append(t % 10)
t /= 10
l = len(a)
return sum([x ** l for x in a]) == n
for x in range(100,1000):
if isArmstrongNumber(x):
print(x)
============================= That's an about ArmstrongNumber's question,when I F5 this code,it's show me OverflowError:int too large to convert to float. SO,what can I do to solve this? Ps:I run it with python3.5 enter image description here