Append an object to a append in PythonYou can append an object to a deque by the append() like list. from collections import deque d = deque([1, 2, 3]) d.append(4) print(d) # deque([1, 2, 3, 4]) for i in d: print(i) # 1 # 2 # 3 # 4
Comments
Powered by Markdown