Given below are two algorithms to shuffle a deck of cards:
 def aShuffle(l):
cards = l[:]
for i in xrange((len(cards)  1), 0, 1):
n = random.randrange(i+1)
cards[i], cards[n] = cards[n], cards[i]
return cards

 def bShuffle(l):
cards = l[:]
for i in xrange(len(cards)):
n = random.randrange(len(cards))
cards[i], cards[n] = cards[n], cards[i]
return cards

Which method's shuffles are closest to a random shuffling of cards?
Details
 The more uniform the probability distribution between all possible permutations of the cards, the better the shuffling algorithm is.
 Assume that
random.randrange
is perfectly uniformly random.