programming-examples/python/Function/Python function to multiply all the numbers in a list.py

6 lines
149 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
def multiply(numbers):
total = 1
for x in numbers:
total *= x
return total
print(multiply((8, 2, 3, -1, 7)))