def weak_foot_flag(df):
    """
    Compare foot of pass with footedness of player
    Provides flag = 1 if pass played with weak foot of the player
    """
    tags = df['tags']
    foot = df['foot']

    # tags
    if 401 in tags:
        passFoot = 'L'
    elif 402 in tags:
        passFoot = 'R'
    elif 403 in tags:
        passFoot = 'H'
    else:
        passFoot = 'N'

    # feature
    if (passFoot == 'L') and (foot == 'R'):
        weakFlag = 1
    elif (passFoot == 'R') and (foot == 'L'):
        weakFlag = 1
    else:
        weakFlag = 0

    return weakFlag