from machine import Pin
from utime import sleep
import random
ldr = Pin(27, Pin.IN)
# button = Pin(26, Pin.IN, Pin.PULL_UP)  # Assuming the button is connected with a pull-up resistor

while True:
    print("Hello")
    if( ldr.value()):
        value = random.randint(0,1)
        print('value = {}'.format(value))
    else:
        print("LDR Not available")

    
    sleep(3)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT