Oct-17-2020, 02:58 PM
from collections import deque foo = deque([1,2,3], maxlen=3) print(foo) foo.rotate(5) print(foo) foo.append(4) print(foo)
Output:deque([1, 2, 3], maxlen=3)
deque([2, 3, 1], maxlen=3)
deque([3, 1, 4], maxlen=3)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs