While opening a file as an example.
while open(“ext.ext”, “r”) as f:
….output = f.readlines()
….len(output)
….print(output[0:5])
This would create a list and 1 element per lines
The Len would be the total of element in the list
The output here would mean, show me the 1st element up to the fifth ( the 1st element is always included and the last is not in the expression [X:X]