Let say I have a list l
l = ['a', 'b', 'c']
To iterate through the list,
for i in l:
# <some function>
My problem is how should I represet it in a flowchart? Should I use i as index? Thanks in advance.
Here is the usual way to do it (from http://etutorials.org/Programming/visual-c-sharp/Part+I+Introducing+Microsoft+Visual+C+.NET/Chapter+5+Flow+of+Control/Building+Loops+Using+Iteration+Statements/)
As you progress, you are getting into smaller and smaller subsets of the overall chart.
They can work for looping, of the type of while do
or do while
, because these inherently tell you to jump back to a point (or skip over a block).
But for looping controlled by a variable, it's ugly, I'm afraid.
In your specific case, you could use these terms:
index
to 0index
item still within the list? i.e. is index
< len(list)
?<Some function>
index