Skip to main content

continue

continue

When this is used, it will jump to the next iteration of the loop. Unlike the break keyword, this does not stop the loop completely.

from std import *

vcc = supply("VCC")
gnd = dgnd()

at vcc
wire right 100

# Loop through an array of colors
for i in ["yellow", "red", "blue", "green", "purple"]:

# do not create red or green led!
if i == "red" || i == "green":
continue

add led(i) pin 2
wire right 100

add res(10k)

wire right 100 down 100
to gnd
VCC12D1_1yellow12D1_3blue12D1_5purple12R110kGND