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 188 views
1 answer 184 views
1 answer 164 views
1 answer 220 views
...