Python Tanks - For loop inside a function

Now we return to another simple level to demonstrate ultra-useful thing.
Let us put the "for" loop inside our own function, and pass a number of iterations as a parameter!
So we can reuse "for" very easily.
When defining a function we use some name for a parameter, and plug this name into "for" loop. And when calling a function we put some value instead of that name.

Prev
#see how we define a function #its parameter 'steps' is passed to the 'for' loop def my_forward(steps): for i in range(steps): forward() #and when calling a function we put certain value for parameter my_forward(4) right() my_forward(5) left() #now fix and complete the calling part of code #so the star is reached and picked