Title may be confusing but I don't know how to express myself any better. What I have is a list that looks something like this:
myList = ['a', 'b', 'c', 'd', 'e', 'f']
what I want to do is a for loop that, for example, starts at index 3, so 'd' and then goes to the end but at the end of the list insted of finishing goes back to the beginning, goes through 'a','b','c' and then finishes at 'd'. I tried doing it like this with a while loop:
index = 3
while index != 2:
if index == len(a):
index = 0
else:
pass
print(a[index])
index += 1
This sorta worked but it will never print out 'c' but if I put 3 as index the loop will never even start. Is there a more elegant solution to do something like this?