I've tried to create a program that checks each number to see if it is equal to the sum of the factorials of its individual digits. For some reason that eludes me, it fails to add any values to the list, and if I were to print the summed variable after each instance, it would display summed as equal to 0. Can anyone help?
import math
x = 2
y = 0
summed = 0
listed = []
while x < 10000000:
x += 1
summed = 0
xString = str(x)
xLength = len(xString)
while y < xLength:
summed += math.factorial(int(xString[y]))
y += 1
if (x == summed):
listed.append(x)
y = 0
summed = 0
listLength = len(listed)
while y < listLength:
summed += listed[y]
y += 1
print(listed)
print(summed)