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 407 views
1 answer 270 views
1 answer 587 views
1 answer 234 views
2 answers 344 views
1 answer 183 views
183 views asked Nov 16, 2022 by avibootz
...