How to find the index of the first occurrence of element in a range of deque in Python

1 Answer

0 votes
import collections 
  
q = collections.deque([1, 18, '27', 2, 'python', 18, 19, 18]) 

print(q.index(18, 3, 6)) 


   
'''
run:
    
5
 
'''

 



answered Jul 21, 2020 by avibootz
...