Advertisement
rfmonk

collections_deque.py

Jan 9th, 2014
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import collections
  5.  
  6. d = collections.deque('abcdefg')
  7. print 'Deque:', d
  8. print 'Length:', len(d)
  9. print 'Left end:', d[0]
  10. print 'Right end:', d[-1]
  11.  
  12. d.remove('c')
  13. print 'remove(c):', d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement