Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
1 of 2

You need to set the pin as an output before you use it.

To do that add the folowing line:

GPIO.setup(red, GPIO.OUT)

below the matching lines for green and yellow:

GPIO.setup(yellow, GPIO.OUT)        ## set output
GPIO.setup(green, GPIO.OUT)