- [Instructor] The last collection class…that we'll take a look at in this chapter…is called a deque.…Now the name may look like it says de queue,…but it's actually pronounced deque,…and it's sort of a hybrid object…between a stack and a queue.…In fact, the name itself basically means…double-ended queue.…You can use them to append or pop data from either side,…and they are designed to be memory-efficient…when accessing them from either end.…Deques can be initialized to be either empty…or get their initial data from an existing, iterable object,…and they can also be specified to have a maximum length.…
To add data to a deque, you use either the…append or append left methods to add items…onto the end or the beginning,…and similarly, items can be removed…using either pop or pop left.…Deques also support a rotate function,…which can operate in either direction.…The rotate function takes a parameter…indicating how many items to rotate…and defaults to one,…so positive numbers will rotate to the right,…while negative numbers will rotate to the left,…
- Truth value testing
- Template strings
- Advanced Python functions
- Advanced collections
- Advanced classes and objects
- Python comprehensions: list, dictionary, and set
Skill Level Advanced
1. Python Language Features
2. Built-In Functions
3. Advanced Python Functions
4. Advanced Collections
5. Advanced Classes and Objects
6. Using Logging
7. Python Comprehensions
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.