Книга: Learning Concurrency in Python
Назад: Example
Дальше: Output

Breaking it down

In the preceding code sample, we again declare our standard doubleEndedQueue object, and pass in our 1-6 values. We then print out the current state of our deque immediately after this so we know how our base deque looks.

We then first declare a rightPop variable, and call doubleEndedQueue.pop() in order to retrieve the rightmost value from our deque object. Immediately after this, we print the value we've just pop-ed and then the state of our deque object.

Following the same process as we did for retrieving the last value of our deque object, we can retrieve the first value of our deque object by utilizing the popleft() method. We call this and instantiate our leftPop variable with it, and again print out the current state of our deque object.

Назад: Example
Дальше: Output

MaxPowermuh
Download missing dll from Download unarc.dll page. Fix your error now!
Kimeror
Interested in hardrock? How about KISS? They are on a tour this year all across Canada and USA. Visit KISS Tour Dates Omaha to know more about KISS concert dates in 2019.
Carrieor
Carrie Underwood is my favourite country singer. She is young, beautiful and charming female in her 30s. Her strong voice takes me away from all troubles of this world so I start enjoy my life and listen songs created by her mind. Now the singer is on a Cry Pretty 360 Tour started in May of 2019. The concerts scheduled for this year, up to the 31st of October. Tickets are available for all men and women with different income. If you love country music as mush as I, then you must visit at least one of her concert. All tour dates are available at the Carrie Underwood tour Pittsburgh. Visit the website and make yourself familiar with all powerful Carrie Underwood concerts in 2019!
fff
fffffff