How to get add elements from deque in Python

1 Answer

0 votes
import collections
  
d = collections.deque('python')     
  
print(d)   
 
d.append(3)
d.append('a')
d.append('php')
 
print(d)     


 
'''
run:
 
deque(['p', 'y', 't', 'h', 'o', 'n'])
deque(['p', 'y', 't', 'h', 'o', 'n', 3, 'a', 'php'])
 
'''

 



answered May 6, 2019 by avibootz

Related questions

1 answer 168 views
2 answers 222 views
1 answer 489 views
2 answers 196 views
1 answer 167 views
...