def ean13_key(code):
    code = str(code)
    if len( code ) != 12:
        return False
    else:
        s = 0
        for k in range(len(code)):
            if k%2 != 0:
                s = s + 3 * int( code[k] )
            else:
                s = s + int( code[k] )

        return 10 - s%10
