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)
============================= C'est une question au sujet de la ArmstrongNumber , quand je F5 ce code, il me montre OverflowError: int trop grand pour convertir en float. Alors, que puis-je faire pour résoudre ce problème? Ps: Je l'exécute avec python3.5 enter image description hereOverflowError: int trop grand pour convertir flotter