To create a fixed length queue and to discard old values as you and new values
from collections import deque
dq = deque(maxlen=5)
for i in range(10):
dq.append(i)
print(dq)
Output:
deque([5, 6, 7, 8, 9], maxlen=5)
To create a fixed length queue and to discard old values as you and new values
from collections import deque
dq = deque(maxlen=5)
for i in range(10):
dq.append(i)
print(dq)
Output:
deque([5, 6, 7, 8, 9], maxlen=5)
For further actions, you may consider blocking this person and/or reporting abuse
Super Kai (Kazuya Ito) -
A0mineTV -
TheDev -
Super Kai (Kazuya Ito) -
Top comments (0)