input: Write a function to deal cards from a shuffled deck and return a list of cards.
  assert len(deal_cards(5))==5
  assert all(isinstance(card, Card) for card in deal_cards(3))
  assert len(deal_cards(0))==0
output: import random
  from collections import namedtuple
  
  Card = namedtuple('Card', ['rank', 'suit'])
  
  def deal_cards(n):
      ranks = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
      suits = ['hearts', 'diamonds', 'clubs', 'spades']
      deck = [Card(rank, suit) for rank in ranks for suit in suits]
      random.shuffle(deck)
      return deck[:n]