You get any card as an argument. Your task is to return a suit of this card.

Our deck (is preloaded):
```python
DECK = ['2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS',
        '2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD',
        '2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH',
        '2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC']
```

```python
('3C') -> return 'clubs'
('3D') -> return 'diamonds'
('3H') -> return 'hearts'
('3S') -> return 'spades'
```

Difficulty: introductory

Starter code:

def define_suit(card):
	

Solutions:
def define_suit(card):
    d = {'C': 'clubs', 'S':'spades', 'D':'diamonds','H':'hearts'}
    return d[card[-1]]


def define_suit(card):
    return {'C':'clubs', 'S':'spades', 'D':'diamonds', 'H':'hearts'}[card[-1]]

def define_suit(card):
    return {'C':'clubs','D':'diamonds','H':'hearts','S':'spades'}[card[-1]]

def define_suit(card):
    suit = {'C':'clubs', 'D':'diamonds', 'H':'hearts', 'S':'spades'}
    return suit[card[-1]]

def define_suit(card):
    a = { 'C':'clubs', 'D':'diamonds', 'H':'hearts', 'S':'spades'}
    return a.get(card[-1])

def define_suit(card):
  return next(suit for suit in ['clubs', 'diamonds', 'hearts', 'spades'] if card[-1].lower() == suit[0])

def define_suit(card):
    print(card)
    dict = {"C": 'clubs', "S": 'spades', "D": 'diamonds', "H": 'hearts'}
    return(dict[card[-1]])

# What's the point of the preloaded deck?
D = {'S':"spades", 'D':"diamonds", 'H':"hearts", 'C':"clubs"}

def define_suit(card):
    return D[card[-1]]

def define_suit(card):
    return '{}'.format({'C':'clubs', 'S': 'spades', 'D': 'diamonds', 'H': 'hearts'}.get(card[-1]))

suits={'S':"spades",'C':"clubs",'D':"diamonds",'H':"hearts"}
def define_suit(card):
    return suits[card[-1]]

def define_suit(card):
    return {'C':'clubs', 'D':'diamonds', 'H':'hearts', 'S':'spades'}.get(card[-1])

SUITS = 'diamonds clubs hearts spades clubs diamonds spades hearts'.split()

def define_suit(card):
    return SUITS[ord(card[-1])%7]
    


define_suit = lambda card: {'C': 'clubs', 'S': 'spades', 'D': 'diamonds', 'H': 'hearts'}[card[-1]]

def define_suit(card: str) -> str:
    """ Get a suit of given card. """
    return {
        "c": "clubs",
        "d": "diamonds",
        "h": "hearts",
        "s": "spades"
    }.get(card[-1].lower())

def define_suit(card):
    return "clubs" if 'C' in card else 'spades' if 'S' in card else 'diamonds' if 'D' in card else 'hearts'

def define_suit(card):
    # Good luck
    return {"C":"clubs","S":"spades","D":"diamonds","H":"hearts"}.pop(card[-1])

def define_suit(card):
    return ['clubs', 'spades', 'diamonds', 'hearts'][('S' in card) + 2 * ('D' in card) + 3 * ('H' in card)]

define_suit = lambda x:{'C':'clubs','D':'diamonds','H':'hearts','S':'spades'}[x[-1:]]

def define_suit(card):
    DECK = ['2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS',
        '2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD',
        '2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH',
        '2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC']
    if card[-1] == 'S':
        return 'spades'
    elif card[-1] == 'C':
        return 'clubs'
    elif card[-1] == 'D':
        return 'diamonds'
    else:
        return 'hearts'

def define_suit(card):
    if "C" in card: return 'clubs'
    if "D" in card: return 'diamonds'
    if "H" in card: return 'hearts'
    if "S" in card: return 'spades'
    

# ('3C') -> return 'clubs'
# ('3D') -> return 'diamonds'
# ('3H') -> return 'hearts'
# ('3S') -> return 'spades'


def define_suit(card):
    for letter in card:
        if letter.upper() == 'C':
            return 'clubs'
        elif letter.upper() == 'S':
            return 'spades'
        elif letter.upper() == 'D':
            return 'diamonds'
        elif letter.upper() == 'H':
            return 'hearts'

def define_suit(card):
    suits = {
        'C': 'clubs',
        'D': 'diamonds',
        'H': 'hearts',
        'S': 'spades',
    }
    if card[-1] not in suits:
        pass
    
    
    return suits[card[-1]]

def define_suit(card):
    return 'clubs' if 'C' in card \
        else 'diamonds' if 'D' in card \
        else 'hearts' if 'H' in card \
        else 'spades'

def define_suit(card):
    for i in card:
        if "S" in card:
            return "spades"
        elif "D" in card:
            return "diamonds"
        elif "H" in card:
            return "hearts"
        elif "C" in card:
            return "clubs"

def define_suit(card):

    if len(card) == 2:
        if card[1] == "C":
            return 'clubs'
        elif card[1] == "D":
            return 'diamonds'
        elif card[1] == "H":
            return 'hearts'
        elif card[1] == "S":
            return 'spades'
    else:
        if card[2] == "C":
            return 'clubs'
        elif card[2] == "D":
            return 'diamonds'
        elif card[2] == "H":
            return 'hearts'
        elif card[2] == "S":
            return 'spades'

def define_suit(card):
    clubs = {"C": "clubs", "D": "diamonds", "H": "hearts", "S": "spades"}
    
    return clubs[card[-1]]

def define_suit(card):
    letter = card[-1]
    if letter == "C":
        return 'clubs'
    elif letter == "S":
        return 'spades'
    elif letter == "D":
        return 'diamonds'
    else:
        return 'hearts'

def define_suit(card):
    return 'clubs' if card.endswith('C')==True else 'diamonds' if card.endswith('D')==True else 'hearts' if card.endswith('H')==True else 'spades'

m = {
    'C': 'clubs',
    'D': 'diamonds',
    'H': 'hearts',
    'S': 'spades'
}
def define_suit(card):
    return m.get(card[-1])

def define_suit(card):
  
    suite = card[-1]
    if card[-1] == 'S':
      return 'spades'
    elif card[-1] == 'D':
      return 'diamonds'
    elif card[-1] == 'H':
      return 'hearts'
    else:
      return 'clubs'

def define_suit(card):
    # Good luck
    return 'clubs' if card[-1]=='C' \
            else 'spades' if card[-1]=='S' \
            else 'diamonds' if card[-1]=='D' \
            else 'hearts' if card[-1]=='H' \
            else None

def define_suit(card):
    dicc={
        'C':'clubs', 
        'D':'diamonds', 
        'H':'hearts', 
        'S':'spades'
    }
    return dicc[card[-1:].upper()]

def define_suit(card):
#     if card[-1] == "C":
#         return "clubs"
#     elif card[-1] == "S":
#         return "spades"
#     elif card[-1] == "D":
#         return "diamonds"
#     elif card[-1] == "H":
#         return "hearts"
    a = {
        "C":"clubs",
        "S":"spades",
        "D":"diamonds",
        "H":"hearts"
    }
    if card[-1] in a:
        return a[card[-1]]

def define_suit(card):
    return "clubs" if 'C' in card else "diamonds" if'D' in card else "hearts" if 'H' in card else "spades"

dict = {'C' : 'clubs',
        'S' : 'spades',
        'D' : 'diamonds',
        'H' : 'hearts',
       }

def define_suit(card):
    return dict.get(card[-1])

def define_suit(card):
    if card[-1] == "C" : return 'clubs'
    if card[-1] == "S" : return 'spades'
    if card[-1] == "D" : return 'diamonds'
    return 'hearts'


def define_suit(card):
    # Good luck
    DECK = ['2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS',
        '2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD',
        '2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH',
        '2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC']
    d={'C':'clubs','D':'diamonds','H':'hearts','S':'spades'}
    return d[card[-1]]

def define_suit(card: str) -> str:
    return (
        "clubs"
        if "C" in card
        else "diamonds"
        if "D" in card
        else "hearts"
        if "H" in card
        else "spades"
    )

def define_suit(card):
    if 'S' in card:
        return 'spades'
    elif 'C' in card:
        return 'clubs'
    elif 'H' in card:
        return 'hearts'
    else:
        return 'diamonds'

def define_suit(card):
    d={'C':'clubs','S':'spades','D':'diamonds','H':'hearts'}
    return d.get(card[-1])

def define_suit(card):
    print(card)
    return ('clubs', 'spades', 'diamonds', 'hearts')['CSDH'.index(card[-1])]

def define_suit(card):
    if card[1] == 'C':
        return 'clubs'
    elif card[1] == 'S':
        return 'spades'
    elif card[1] == 'D':
        return 'diamonds'
    elif card[1] =='H':
        return 'hearts'
    elif card[1] =='0':
        if card[2] == 'C':
            return 'clubs'
        elif card[2] == 'S':
            return 'spades'
        elif card[2] == 'D':
            return 'diamonds'
        elif card[2] =='H':
            return 'hearts'

def define_suit(cards):
    return 'clubs' if 'C' in cards else 'diamonds' if 'D' in cards else 'hearts' if 'H' in cards else 'spades'
    # Good luck


def define_suit(card):
    c=card[-1]
    if c=='C':
        return 'clubs'
    elif c=='D':
        return 'diamonds'
    elif c=='H':
        return 'hearts'
    else:
        return 'spades'

def define_suit(card):
    ls = [char for char in card]
    if ls[-1] == 'C':
        return 'clubs'
    elif ls[-1] == 'D':
        return 'diamonds'
    elif ls[-1] == 'H':
        return 'hearts'
    else:
        return 'spades'


def define_suit(card):
    suits = {'C': 'clubs','D': 'diamonds','S': 'spades','H': 'hearts'}
    if card[-1] in suits:
        return suits[card[-1]]

def define_suit(card):
    return {'C': 'clubs', 'S': 'spades', 'D': 'diamonds', 'H': 'hearts'}.setdefault(card[-1], None)

def define_suit(card):
    if card[-1] is 'C':
        return 'clubs'
    elif card[-1] is 'S':
        return 'spades'
    elif card[-1] is 'D':
        return 'diamonds'
    elif card[-1] is 'H':
        return 'hearts'
    


def define_suit(card):
    v = {"C":"clubs", "S":"spades", "D":"diamonds", "H":"hearts"}
    return v[card[-1]]

def define_suit(card):
    SUITS = ['clubs', 'diamonds', 'hearts', 'spades']
    for i in SUITS:
        if card[-1] ==  str.upper(i[0]):
                return i

def define_suit(card):
    if card.endswith('C'):
        return 'clubs'
    elif card.endswith('S'):
        return 'spades'
    elif card.endswith('H'):
        return 'hearts'
    elif card.endswith('D'):
        return 'diamonds'

def define_suit(card):
    return 'clubs' if 'C' in card else 'diamonds' if 'D' in card else 'hearts' if 'H' in card else 'spades' if 'S' in card else False

def define_suit(card):

    what = {"C":"clubs",
            "D":"diamonds",
            "H":"hearts",
            "S":"spades"}
    
    for k,v in list(what.items()):
        if k in card:
            return v


def define_suit(c):
    return {'C':'clubs', 'D':'diamonds', 'H':'hearts', 'S':'spades'}.get(c[-1])

def define_suit(card):
    suits = {
    'C' : 'clubs',
    'D' : 'diamonds',
    'S' : 'spades',
    'H' : 'hearts'
    }
    
    return suits.get(card[-1])

def define_suit(card):
    d = {'S':'spades','D':'diamonds','H':'hearts','C':'clubs'}
    return d[card[1]] if len(card)<3 else d[card[2]]

def define_suit(card):
    a = {"C": "clubs", "D": "diamonds", "H": "hearts", "S": "spades"}
    return a[card[-1]] if card[-1] in a else False

def define_suit(card):
    for k in card:
        if k=='C':
            return 'clubs'
        elif k=='D':
            return 'diamonds'
        elif k=='H':
            return 'hearts'
        elif k=='S':
            return 'spades'

def define_suit(card):
    for elem in card:
        if 'S' in card:
            return 'spades'
        elif 'D' in card:
            return 'diamonds'
        elif 'H' in card:
            return 'hearts'
        else:
            return 'clubs'

def define_suit(card):
    if card[-1] == 'C':
        return 'clubs'
    if card[-1] == 'D':
        return 'diamonds'
    if card[-1] == 'H':
        return 'hearts'
    if card[-1] == 'S':
        return 'spades'
    return ''


def define_suit(card):
    if card in ['2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC']: return 'clubs'
    if card in ['2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS']: return 'spades'
    if card in ['2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD']: return 'diamonds'
    if card in ['2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH']: return 'hearts'

def define_suit(card):
    switcher = {'C' : 'clubs', 'S': 'spades', 'D': 'diamonds', 'H': 'hearts'}
    return switcher[card[-1]]

def define_suit(card):
    if card[-1] == 'C':
        return 'clubs'
    elif card[-1] == 'S':
        return 'spades'
    elif card[-1] == 'H':
        return 'hearts'
    else:
        return 'diamonds'

def define_suit(card):
    if "D" in card:
        return "diamonds"
    elif "S" in card:
        return "spades"
    elif "C" in card:
        return "clubs"
    else:
        return "hearts"

value = { "C" : "clubs",
          "D" : "diamonds",
          "H" : "hearts",
          "S" : "spades"
          }

def define_suit(card):
   return value.get(card[-1])
    


value = { "C" : "clubs",
          "D" : "diamonds",
          "H" : "hearts",
          "S" : "spades"
          }

def define_suit(card):
    if card[-1] in value:
        return value.get(card[-1])


import re
def define_suit(card):
    if re.search(r"D\Z",card):
        return "diamonds"
    if re.search(r"C\Z",card):
        return 'clubs'
    if re.search(r"H\Z",card):
        return 'hearts'
    if re.search(r"S\Z",card):
        return 'spades'
    


def define_suit(card):
  suits = {
    "C": "clubs",
    "D": "diamonds",
    "H": "hearts",
    "S": "spades",
  }
  last_char = card[-1]
  return suits[last_char]


def define_suit(card):
    if card[-1]=="D": return 'diamonds'
    elif card[-1]=="C": return 'clubs'
    elif card[-1]=="S": return 'spades'
    else: return 'hearts'

def define_suit(c):
#     return {
#         'C': 'clubs',
#         'D': 'diamonds',
#         'H': 'hearts',
#         'S': 'spades'
#     }.get(c[-1])
    return {'C':'clubs', 'D':'diamonds', 'H':'hearts', 'S':'spades'}[c[-1]]

def define_suit(card):
    d={
    'C': 'clubs',
    'D': 'diamonds',
    'H': 'hearts',
    'S': 'spades',
    }
    a = list(card)
    return d.get(a[-1])

def define_suit(card):
    for each in card:
        if each[-1] == 'C':
            return 'clubs'
        elif each[-1] == 'D':
            return 'diamonds'
        elif each[-1] == 'H':
            return 'hearts'
        elif each[-1] == 'S':
            return 'spades'

def define_suit(card):
    c={
    'C':'clubs',
    'D':'diamonds',
    'H':'hearts',
    'S':'spades'
    }
    return c.get(card[-1])

def define_suit(c):
    return 'clubs' if "C" in c else 'spades' if "S" in c else 'diamonds' if "D" in c else 'hearts'

import re
def define_suit(card):
    if re.search(r'C', card):
        return "clubs"
    elif re.search(r'D', card):
        return "diamonds"
    elif re.search(r'H', card):
        return "hearts"
    elif re.search(r'S', card):
        return "spades"

def define_suit(card):
    if card[-1] == "D":
        return "diamonds"
    elif card[-1] == "C":
        return "clubs"
    elif card[-1] == "H":
        return "hearts"
    elif card[-1] == "S":
        return "spades"


define_suit = lambda card: {'S': 'spades', 'D': 'diamonds', 'H': 'hearts', 'C': 'clubs'}[card[-1]]

def define_suit(card):
    dictionary = {'C':'clubs','D':'diamonds','S':'spades','H':'hearts'}
    
    return dictionary.get(card[-1])

def define_suit(card):
    if card[-1] == "D":
        return "diamonds"
    if card[-1] == "H":
        return "hearts"
    if card[-1] == "C":
        return "clubs"
    if card[-1] == "S":
        return "spades"

def define_suit(card):
    if 'C' in card:
        return 'clubs'
    elif 'D' in card:
        return 'diamonds'
    elif 'H' in card:
        return 'hearts'
    elif 'S' in card:
        return 'spades'
    else:
        return None

def define_suit(card):
    dave_fuck = {'C' : 'clubs', 'D' : 'diamonds', 'H' : 'hearts', 'S' : 'spades'}
    return dave_fuck[card[-1]]

def define_suit(card):
    dict = {
        'C' : 'clubs',
        'D' : 'diamonds',
        'H' : 'hearts',
        'S' : 'spades',
            }
    return dict.get(card[-1])

def define_suit(card):
    if card[-1] == 'C': return 'clubs'
    if card[-1] == 'S': return 'spades'
    if card[-1] == 'H': return 'hearts'
    if card[-1] == 'D': return 'diamonds'

def define_suit(card):
    if card[len(card)-1]=='S':
       return 'spades'
    elif card[len(card)-1]=='C':
       return 'clubs'
    elif card[len(card)-1]=='D':
       return 'diamonds'
    else:
       return 'hearts'

def define_suit(card):
    if card[-1] == 'C':
        return 'clubs'
    elif card[-1] == 'D':
        return 'diamonds'
    elif card[-1] == 'H':
        return 'hearts'
    return 'spades'

def define_suit(card):
    return ('clubs', 'spades', 'diamonds', 'hearts')[{'C':0,'S':1,'D':2,'H':3}.get(card[-1])]

L = {'C': 'clubs', 'S': 'spades', 'D': 'diamonds', 'H': 'hearts'}
def define_suit(card):
    return L[card[-1]]

def define_suit(card):
    head = {'C': 'clubs', 'S': 'spades', 'D': 'diamonds', 'H': 'hearts'}
    return head[card[-1]]

def define_suit(card):
    card = card.lower()
    if "c" in card:
        return "clubs"
    elif "d" in card:
        return "diamonds"
    elif "h"in card:
        return "hearts"
    elif "s" in card:
        return "spades"

def define_suit(card):
    if "C" in card: return "clubs"
    if "S" in card: return "spades"
    if "H" in card: return "hearts"
    if "D" in card: return "diamonds"


def define_suit(card):
    dict_suits = {
        'C': 'clubs',
        'D': 'diamonds',
        'H': 'hearts',
        'S': 'spades',
        }
        
    return dict_suits[card[-1]]

def define_suit(card):
    suite = {
        'C': 'clubs',
        'D': 'diamonds',
        'H': 'hearts',
        'S': 'spades'
    }
    return suite[card[-1]]

def define_suit(c):
    return 'clubs' if c[-1]=='C' else 'spades' if c[-1]=='S' else 'hearts' if c[-1]=='H' else 'diamonds'