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 295 views
1 answer 186 views
1 answer 503 views
1 answer 151 views
2 answers 206 views
1 answer 111 views
111 views asked Nov 16, 2022 by avibootz
...