top of page

Python Programming Help

Public·2 members

How to check queue length in Python

To find length of queue in python 3, we use len() method


Example :



queue= deque([])   #is this length 0 queue?
print(len(queue))

#adding one element
queue.appned(1) #is this length 1 queue?
print(len(queue))

len(queue) will give you the result.

1365 Views
bottom of page