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 270 views
1 answer 267 views
1 answer 243 views
1 answer 323 views
...