Skip to content

Commit 68425fa

Browse files
committed
rebased to resolve commit a0d0905 from @norvig
2 parents e207551 + a0d0905 commit 68425fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ def unique(seq):
6161
return list(set(seq))
6262

6363
def product(numbers):
64-
"""Return the product of the numbers."""
65-
result=1
66-
for i in numbers:
67-
result=result*i
64+
"""Return the product of the numbers, e.g. product([2, 3, 10]) == 60"""
65+
result = 1
66+
for x in numbers:
67+
result *= x
6868
return result
6969

7070
def count_if(predicate, seq):

0 commit comments

Comments
 (0)