How to append values to deque in Python

1 Answer

0 votes
import collections

d = collections.deque('python')     

d.append('java')
d.append('c')

print(d)



'''
run:

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

'''

 



answered May 8, 2019 by avibootz

Related questions

1 answer 278 views
1 answer 260 views
1 answer 270 views
2 answers 299 views
299 views asked Apr 24, 2021 by avibootz
1 answer 235 views
235 views asked Aug 28, 2020 by avibootz
2 answers 321 views
1 answer 352 views
...