Dictionary Bug ? Python 1.5 & 2.2

Paul Rubin phr-n2002a at nightsong.com
Sun Jan 6 06:34:30 EST 2002


It's no big deal.  Dictionaries work by hashing which means the
elements come out in essentially random order.  If you want them in
a specific order, sort them:
  a = board.keys()
  a.sort()
  for k in a:
      print k + " \t", board[k]



More information about the Python-list mailing list