Re: Converting a flat list to a list of tuples

2005-11-22 Thread metiu uitem
Thanks for the answer... yes the example was wrong! -- http://mail.python.org/mailman/listinfo/python-list

Converting a flat list to a list of tuples

2005-11-22 Thread metiu uitem
Say you have a flat list: ['a', 1, 'b', 2, 'c', 3] How do you efficiently get [['a', 1], ['b', 2], ['c', 3]] I was thinking of something along the lines of: for (key,number) in list: print key, number but it's not working... Thank you -- http://mail.python.org/mailman/listinfo/python-list