def black_pins(guess, code):
    """guess, code: 4-element lists of strings from COLORS
    Returns the number of black pins, determined by the standard
    Mastermind rules
    """
    pins = 0
    for i in range(min(len(guess), len(code))):
        if guess[i] == code[i]:
            pins += 1

    return pins