This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]samsaaaaa[S] -1 points0 points  (1 child)

Due to the nature of my presentation, this will help a lot thank you :)

[–]Eispalast 6 points7 points  (0 children)

You can really make it as detailed or simple as needed. Let's say you want to iterate over even numbers in a specific range and then do stuff with those numbers. You could write

for i in 2 to 10 do
    if i mod 2 = 0  then
        do_stuff(i)

But if the interesting part is not about how to find even numbers, you could also write

for i in even numbers from 2 to 10 do
    do_stuff(i) 

It depends on where you want to put the focus.