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 300 views
1 answer 192 views
1 answer 508 views
1 answer 155 views
2 answers 215 views
1 answer 116 views
116 views asked Nov 16, 2022 by avibootz
...