def calculate_checksum(self):
        """Calculates the checksum for UPCA/UPC codes

        :return: The checksum for 'self.upc'
        :rtype: Integer
        """
        def sum_(x, y): return int(x) + int(y)
        upc = self.upc[0:self.digits]
        oddsum = reduce(sum_, upc[::2])
        evensum = reduce(sum_, upc[1::2])
        check = (evensum + oddsum * 3) % 10
        if check == 0:
            return 0
        else:
            return 10 - check
Calculates the checksum for UPCA/UPC codes

        :return: The checksum for 'self.upc'
        :rtype: Integer