How to create an empty deque with maximum length in Python

2 Answers

0 votes
import collections     

d = collections.deque(maxlen=3)
print(d) 


'''
run:

deque([], maxlen=3)

'''

 



answered May 8, 2019 by avibootz
0 votes
import collections     

d = collections.deque([], 3)
print(d) 


'''
run:

deque([], maxlen=3)

'''

 



answered May 8, 2019 by avibootz

Related questions

1 answer 186 views
1 answer 179 views
1 answer 156 views
1 answer 218 views
...