Complete the code to turn the LED on.
led = LED(17) led.[1]()
The on() method turns the LED on.
Complete the code to make the LED blink once.
led = LED(18) led.[1](1)
The blink() method makes the LED blink. The argument 1 means blink once.
Fix the error in the code to toggle the LED state.
led = LED(22) led.[1]()
The toggle() method changes the LED from on to off or off to on.
Fill both blanks to create a dictionary with LED pins and the results of LED methods on those pins.
led_states = {17: LED(17).[1](), 18: LED(18).[2]()}The is_lit() method checks if the LED is on, and off() turns the LED off.
Fill all three blanks to create a dictionary comprehension with LED pin names and states.
led_status = {{ [1]: LED([3]).[2]() for [3] in [17, 18, 22] }}The dictionary uses the pin number as key (pin), calls is_lit() to get the LED state, and loops over pins using pin.
