Introduction
The iterator protocol lets you go through items one by one in a simple way. It helps you work with collections like lists or custom objects easily.
When you want to loop through items in a list, tuple, or set.
When you create your own object that holds many items and want to make it easy to loop over.
When you want to read data step-by-step, like reading lines from a file.
When you want to save memory by processing items one at a time instead of all at once.