a和b是两个列表变量,已知a=[3,6,9],键盘输入b,计算a中元素与b对应元素乘积的累加和。
a = [3,6,9] b = eval(input('请输入列表b:')) s = 0 for i in range(3): s += a[i] * b[i] print(s)