print ('This program will ask you to guess a correct number')
from machine import Pin
from utime import sleep
built_in_LED = Pin(12, Pin.OUT) #gpio pin no, IN or OUT
External_LED = Pin(13, Pin.OUT)
target = int(input('inter your favorite number from 1 - 9999: '))
#target = 33
while True:
print('====INSTRUCTION TO YOUR FRIEND====')
# obtain input from the user:
value = int(input('Enter an integer between 1 and 9999: '))
if value > target:
print('WRONG!', value, 'is high/too high')
for a in range (3):
built_in_LED.on()
sleep(0.5)
built_in_LED.off()
sleep(0.5)
elif int(value) < target:
print('WRONG!', value, 'is low/too low')
for a in range (3):
built_in_LED.on()
sleep(0.5)
built_in_LED.off()
sleep(0.5)
else:
print('Perfect! Kudos!')
for a in range (3):
External_LED.on()
sleep(0.5)
External_LED.off()
sleep(0.5)
break