I’m currently learning Python and playing around with some projects on a couple of Pi’s I bought.
I wrote a nested IF statement script that activated LEDs if switches were open or closed. For example if the switch in the first IF statement was closed the red LED came on and stayed on, the script moved to the second IF statement if the switch referenced here was closed the green led came on….and so on.
This is just a bit of fun while I learn about Python, but I thought when the second IF statement is running, if the switch in the first IF were to change the LED wouldn’t react to that change, am I right? Is that a whole new level I’ll learn in the future? Maybe that is outside the capabilities of a nested IF statement?
put on hold as off-topic by joan, Milliways, Steve Robillard, Darth Vader♦ 1 hour ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- “This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center.” – joan, Milliways, Steve Robillard, Darth Vader