Skip to content

Instantly share code, notes, and snippets.

@antonkartashov
Last active January 27, 2016 02:41
Show Gist options
  • Save antonkartashov/b20adcecedd49efe9f91 to your computer and use it in GitHub Desktop.
Save antonkartashov/b20adcecedd49efe9f91 to your computer and use it in GitHub Desktop.
# Цикл от 2 до 20 с шагом 3
for j in [2...20] by 3
x = j * j
print x
# Цикл от 1 до n, где n — количество элементов в массиве
for k in [3, 5, 8, 13, 21]
x = k * k
print x
for text in ['one', 'two', 'three']
x = "number " + text
print x
for text, i in ['one', 'two', 'three']
x = i + ". number " + text
print x
for layer, index in sketch.group.subLayers
layer.scale = 0.5
# Цикл внутри объекта
for name, layer of sketch
layer.opacity = 0.5
# Цикл без параметра
for [1...5]
print "Hello World!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment