lst1 = [2,3,4]
lst2 = [1,2,3]
def func_mu(lst1,lst2):
lst = []
count = len(lst1)+len(lst2)-1 #循环进行次数
count_hou = count//2 #后半部分次数
for i in range(count):
juanji = 0
if (i<=count_hou):
for j in range(i+1):
juanji += lst1[j]*lst2[i-j]
lst.append(juanji)
else:
for j in range(i- count_hou, count_hou+1):
juanji += lst1[j]*lst2[i-j]
lst.append(juanji)
return lst
print(func_mu(lst1,lst2))
03-22
1941
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交