# In your code, def clear(): means you are defining a function named clear. # We have to call the function for it to work. By having the function outside of our main code # we can call this function from anywhere in our program. def clear(): """Turn all LEDs off.""" for i in range(NUM_LEDS): #At the start of the code, a variable NUM_LEDS = 12 tells the code we have 12 LEDs np[i] = (0, 0, 0) #np (neopixel) [i] the current value of i (from 0 to 11) for NUM_LEDS = 12 print (i) #prints current value of i to Thonny output. np.write() #writes (0, 0, 0) to currently selected aRGB (defined by current value of i) # fill is a function to set the LED colour. # color is a built in python variable that holds an RGB value. # when you call the fill function (fill(color)) you have to set the value of color. # Ex: fill((255, 0, 0)) will set all LEDs red. 'fill' sets all LEDs, not just selected LEDs. def fill(color): """Set every LED to the same colour.""" for i in range(NUM_LEDS): np[i] = color np.write()