reduction

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Wed Jun 1 17:44:23 EDT 2016


On Wednesday, June 1, 2016 at 2:22:42 AM UTC+12, Fillmore wrote:
> ['a','b','c','l'] => 0  # If "l" is in my data I have a zero
> ['a','b','c'] => 1      # or a more generic match will do the job

    for entry in \
        (
            ['a','b','c','l'],
            ['a','b','c'],
        ) \
    :
        flag = int(not any(m == "l" for m in this_list))
        ... # flag is the 1/0 code you’re looking for ...
    #end for



More information about the Python-list mailing list