我想从我的代码只能将列表中的数字相乘的范围内获得一个提供特定要求 的列表。我想在列表中乘以数字的“数字平方”
例如:定义的范围 = (1,200)
Wanted_list =[1^2,2^2,3^2,...,(34 = 3^2 * 4^2),(35 = 3^2 * 5^2),...,(199 = 1^2 * 9^2 * 9^2)]
这是我的代码:
def mult(liste):
a=1
for i in liste:
a*=i #I think the problem is here
return a
listemm = [x for x in range(1,200)]
print(listemm)
qe= [mult(int(digit) for digit in str(numb)) for numb in listemm]
print(qe)