import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(5,GPIO.IN) if GPIO.input(5): print("input was high") else: print("input was low")