RPi.GPIO pins - check state
<p>I'm using the RPi.GPIO module in Python to turn on and off GPIO pins on the Raspberry Pi 3.</p>

<p>Is there a way to identify whether an output pin is ON or OFF and put that value into a variable that I can use to decide whether the pin is ON and needs to turn OFF, or is OFF and needs to turn ON.</p>