(Python3) 连加 连乘 代码

2020-01-17 12:32:50 浏览数 (1)

a=[1,2,3,4,5,6,7,8,9,10]

#连加

b=0

for i in a:

  b =i

print(b)

#连乘

c=1

for i in a:

  c*=i

print(c)

0 人点赞