Fully loop over a list with different starting index

Viewed 498

So i have this list

station_list = [1, 2, 3, 4]

This is an example, the real list could be longer, but always this pattern with increasing integers. As a part of my code, if some condition is fulfilled, i want to access that list at a different point than 1. Let's say i want to start iterating at 2. How can i iterate over the list with a for-loop starting at 2, but still getting all elements exactly once? So iteration order should be 2, 3, 4, 1.

5 Answers
Related