We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13fce49 commit 1080baaCopy full SHA for 1080baa
1 file changed
barcode/ean.py
@@ -59,7 +59,7 @@ def calculate_checksum(self):
59
:returns: The checksum for `self.ean`.
60
:rtype: Integer
61
"""
62
- sum_ = lambda x, y: int(x) + int(y)
+ def sum_(x, y): return lambda x, y: int(x) + int(y)
63
evensum = reduce(sum_, self.ean[::2])
64
oddsum = reduce(sum_, self.ean[1::2])
65
return (10 - ((evensum + oddsum * 3) % 10)) % 10
@@ -140,7 +140,7 @@ def calculate_checksum(self):
140
141
142
143
144
145
146
return (10 - ((evensum * 3 + oddsum) % 10)) % 10
0 commit comments