The iter() method creates an object which can be iterated one element at a time.
These objects are useful when coupled with loops like for loop, while loop.
The syntax of iter() method is:
iter(object[, sentinel])
As an example using the sentinel bit of this code
with open('mydata.txt') as fp:
for line in iter(fp.readline, ''):
processLine(line)
and so the stop value is a blank line. But the , inside the [ ] array notation is confusion. Clearly the , comes between the object in the sentinel in my example and what would be more a complex example of code that would clarify this kind of use of a sentinel?