def f():
result = []
for i in range(100, 10000):
str_num = str(i)
num = sum([int(x) ** len(str_num) for x in str_num])
if num == i:
result.append(i)
return result
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
def f():
result = []
for i in range(100, 10000):
str_num = str(i)
num = sum([int(x) ** len(str_num) for x in str_num])
if num == i:
result.append(i)
return result