Sep-26-2021, 11:56 PM
I'm sorry. I don't understand what was edited in the question. The dictionary looks the same to me and the same as the program I gave above creates:
Store the strings in a list or a dict and associate the data you need with them.
Output:{'in_ledS': 0, 'in_ledXL': 1, 'in_ledXXL': 0, 'in_ledS1': 1, 'in_ledS2': 1}
If you need the strings, don't store them as separate variables. You haven't shown how they're used, so right now there's no reason to have the variables.Store the strings in a list or a dict and associate the data you need with them.