How to get remove specific element from deque in Python

2 Answers

0 votes
import collections
 
d = collections.deque('python')     
 
print(d)   

d.remove('t')

print(d)       



'''
run:

deque(['p', 'y', 't', 'h', 'o', 'n'])
deque(['p', 'y', 'h', 'o', 'n'])

'''

 



answered May 6, 2019 by avibootz
0 votes
import collections
  
d = collections.deque('python')     
  
print(d)   
 
d.remove(d[1])
 
print(d)       
 
 
 
'''
run:
 
deque(['p', 'y', 't', 'h', 'o', 'n'])
deque(['p', 't', 'h', 'o', 'n'])

'''

 



answered May 6, 2019 by avibootz

Related questions

...