Changeset 9372 for main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
- Timestamp:
- 21 Oct 2012, 10:43:54 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r9043 r9372 685 685 writer.writerow(row) 686 686 return tmp_path 687 688 def product(sequence, start=1): 689 """Returns the product of a sequence of numbers (_not_ strings) 690 multiplied by the parameter `start` (defaults to 1). If the 691 sequence is empty, returns 0. 692 """ 693 if not len(sequence): 694 return 0 695 result = start 696 for item in sequence: 697 result *= item 698 return result
Note: See TracChangeset for help on using the changeset viewer.