i have some code which looks kinda like 

    bin = {}
    for whatever:
       for [a, b] in foo:
          x = 42 - a
          y = 42 - b
          if bin.has_key(x):
             bin[x] += 1
          else:
             bin[x] = 1
    for i, j in bin.iteritems():
       print i, j

now i want to add a second count column, kinda like

    bin = {}
    for whatever:
       for [a, b] in foo:
          x = 42 - a
          if bin.has_key(x):
             bin[x.b] += 1
          else:
             bin[x.b] = 1
             bin[x.not b] = 0
    for x, y, z in bin.iteritems():
       print x, y, z

should the dict value become a two element list, or is
there a cleaner way to do this?

randy

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to