comparing results of fetchall() with a known value

Skip Montanaro skip at pobox.com
Tue Aug 28 16:32:15 CEST 2001


    michal> how about this:
    michal> simple_list = map((lambda x: x[0]), list_of_tuples)

Actually, for this particular case you can use string.join:

    >>> l = [('smith',), ('johnson',), ('jackson',), ('jones',)]
    >>> map(string.join, l)
    ['smith', 'johnson', 'jackson', 'jones']




More information about the Python-list mailing list