def value(card):
    """Returns the numeric value of a card or card value as an integer 1..13"""
    prefix = card[:len(card) - 1]
    names = {'A': 1, 'J': 11, 'Q': 12, 'K': 13}
    if prefix in names:
        return names.get(prefix)
    else:
        return int(prefix)