It's a list comprehension, which is nice Pythonic (and functional) way of processing the items in a list to produce another list, just as Ron says. Using a print() command inside the comprehension is a bit of a hack, as usually you would use a comprehension to create a new list. List comprehensions are very useful, as you can do lots with them in very little code e.g. filter items, transform items etc, and they do not modify the original list.
If you run the original comprehension in your Python shell, you get results like this:
The command has printed each element from the original list, and also returned a list containing three "None" items - the values returned from the print() command each time. Because print() returns nothing, the comprehension returns a list of nothings:
The fastest and most reliable components of any system are those that are not there. Tiny ad: