How to find the numbers that are the sum of fourth powers of their digits in Python

1 Answer

0 votes
lst = [i for i in range(1000, 1000000) if i == sum(int(d) ** 4 for d in str(i))]

print(lst)




'''
run:

[1634, 8208, 9474]

'''

 



answered Dec 5, 2023 by avibootz
...