News

Many programs have a need to iterate over a large list of generated data. The conventional way to do this would be to calculate the values for the list and populate it, then loop over the whole thing.
Note that we’ve already used Python’s list comprehension in the broken example above, to invoke the list. It’s the expression in the square brackets [], and is basically a short form for loops.
The naive way to do that in Python is to store the numbers in a structure, typically a Python list, then loop over the structure and perform an operation on every element of it.
Python doesn't have a "goto" statement, but in this case I didn't need it. The "else" after a loop is if you never execute break. Make sense? Okay, let's call that code c0.py and run it: % python ...