I have a series of checkboxes with simple values (a, b, c, etc.) that when checked, would "trigger" a string of text to appear. The problem is that I will have a great number of checkboxes, and manually repeating my code below for each checkbox is going to be a mess. I am still learning Python and am struggling with creating a loop to make this happen.
Here is my current (working, but undesirable) code:
if a:
a = 'foo'
if b:
b = 'bar'
...
My attempt at the loop, which returns box
as nothing:
boxes = [a, b, c, ...]
texta = 'foo'
textb = 'bar'
...
for box in boxes:
if box:
box = ('text=%s', box)
What should I do to get my loop functioning properly? Thanks!