<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_check_digit(digits):
 """Calculate and return the GS1 check digit."""

        ints = [int(d) for d in digits]
        l = len(ints)
        odds = slice((l - 1) % 2, l, 2)
        even = slice(l % 2, l, 2)
        checksum = 3 * sum(ints[odds]) + sum(ints[even])
        return str(-checksum % 10)