import RPi.GPIO as GPIO
import time, sys

SWITCH = 18

GPIO.setmode(GPIO.BCM)

GPIO.setup(SWITCH, GPIO.IN)

while True:
    try:
        value = "HIGH" if GPIO.input(SWITCH) == GPIO.HIGH else "LOW"
        print(value)
        time.sleep(0.3)
    except KeyboardInterrupt:
        GPIO.cleanup()
        sys.exit()

28829326462180b9d8c059ad780bb04449b088b2
<mask token>

<mask token>
GPIO.setmode(GPIO.BCM)
GPIO.setup(SWITCH, GPIO.IN)
while True:
    try:
        value = 'HIGH' if GPIO.input(SWITCH) == GPIO.HIGH else 'LOW'
        print(value)
        time.sleep(0.3)
    except KeyboardInterrupt:
        GPIO.cleanup()
        sys.exit()

<mask token>
SWITCH = 18
GPIO.setmode(GPIO.BCM)
GPIO.setup(SWITCH, GPIO.IN)
while True:
    try:
        value = 'HIGH' if GPIO.input(SWITCH) == GPIO.HIGH else 'LOW'
        print(value)
        time.sleep(0.3)
    except KeyboardInterrupt:
        GPIO.cleanup()
        sys.exit()

import RPi.GPIO as GPIO
import time, sys
SWITCH = 18
GPIO.setmode(GPIO.BCM)
GPIO.setup(SWITCH, GPIO.IN)
while True:
    try:
        value = 'HIGH' if GPIO.input(SWITCH) == GPIO.HIGH else 'LOW'
        print(value)
        time.sleep(0.3)
    except KeyboardInterrupt:
        GPIO.cleanup()
        sys.exit()

import RPi.GPIO as GPIO
import time, sys

SWITCH = 18

GPIO.setmode(GPIO.BCM)

GPIO.setup(SWITCH, GPIO.IN)

while True:
    try:
        value = "HIGH" if GPIO.input(SWITCH) == GPIO.HIGH else "LOW"
        print(value)
        time.sleep(0.3)
    except KeyboardInterrupt:
        GPIO.cleanup()
        sys.exit()
