How to get the length of a deque in Python

1 Answer

0 votes
import collections
 
d = collections.deque('python')     
 
print(d)      

print(len(d))      



'''
run:

deque(['p', 'y', 't', 'h', 'o', 'n'])
6

'''

 



answered May 5, 2019 by avibootz

Related questions

2 answers 298 views
1 answer 188 views
1 answer 507 views
1 answer 153 views
2 answers 214 views
1 answer 114 views
114 views asked Nov 16, 2022 by avibootz
...