python 输出所有列表元素的乘积

def multiply_list(items):  
    tot = 1  
    for x in items:  
        tot *= x  
    return tot  
print(multiply_list([1,2,-8]))

  

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/9971278.html