What is the best way to set a start index when iterating a list in Python. For example, I have a list of the days of the week – Sunday, Monday, Tuesday, … Saturday – but I want to iterate through the list starting at Monday. What is the best practice for doing this?
Share
You can use slicing:
This will start at the third element and iterate to the end.