def is_valid(card: str, middle_card: str):
    """
    Function to determine if a card to play is valid given a current middle card. it checks if either the suit,
    the number are acceptable or if the card is a Jack, which can be played on any middle card
    Args:
        card: String of the current card
        middle_card: String of the current middle card

    Returns:
        Boolean if the card is valid
    """
    return card[1] == middle_card[1] or card[0] == middle_card[0] or card[0] == 'J'