[Solved] Convert a int_list() with configurations to bool_list()


If I understood you code and data correctly, each item in pin_configuration begins with the target index, and then the indices to set to True.

In python3, using extended iterable unpacking, you can do the following:

for r, *indices in pin_configuration:
    for j in indices:
        bool_list[r - 1][j - 1] = True

to adapt it to python2 you have to change it like this:

for item in pin_configuration:
    r = item[0]
    indices = item[1:]
    for j in indices:
        bool_list[r - 1][j - 1] = True

0

solved Convert a int_list() with configurations to bool_list()