"""
Base file reading example.

This example uses:
- context manager (with ... as)
- iterator (for ... in object).

"""
if __name__ == '__main__':
    with open("../files/don-diego.txt", "r", encoding="utf-8") as file:
        # Read the file contents line by line
        for count, line in enumerate(file):
            # Lines contain caret return. Using `strip`
            # removes spaces and caret returns at the start and end
            # of the string.
            print(f"{count} : {line.strip()}")
