it's not clear what
b
in your code is/what library is used, but if I get what you want:def light_switch(turn_on=True): b.set_light([1, 2, 9, 10], 'on', turn_on)then if you want to turn lights on
light_switch(True)or just
light_switch()if you want to turn off
light_switch(False)now, as I said it's unclear what b is. so here (as well as in your code) it's a global variable, which is not ideal. there is a good chance that this could be implemented better
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs