import machine
import random
from machine import Pin, Timer
import time
led_red=Pin(0,Pin.OUT)
led_yellow=Pin(2,Pin.OUT)
led_green=Pin(4,Pin.OUT)
while(1):
num = random.random()
print(num)
if num>0.75:
led_green.on()
time.sleep(1)
led_green.off()
if num<0.5:
led_red.on()
time.sleep(1)
led_red.off()
else:
led_yellow.on()
time.sleep(1)
led_yellow.off()
time.sleep(1)