so I have an empty list:
my_list = []
I will be adding elements in an infinite loop function, one element each iteration. The list needs to be limited to the max of 10 elements.
Im looking for an effective way to add new elements, while moving old elements one index back.
Ex:
my_list = [0,1,2,3,4,5,6,7,8,9]
and after using (probably):
my_list.append('10')
I wish to see a list like this:
my_list = [1,2,3,4,5,6,7,8,9,10]
(first element was removed, rest were taken one place back)
Thanks in advance!