Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 909615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:54:35+00:00 2026-05-15T16:54:35+00:00

I am currently creating my deque object using the following, self.CommandList = deque(([‘S’, False,

  • 0

I am currently creating my deque object using the following,

self.CommandList = deque((['S', False, 60],['c'],['g16'],['i50'],['r30', True],['u320'],['o5000'],['b1'],['B4500'],['W1'],['l5154'],['!10'],['p2', True, 10],['e1'],['K20'],['U0'],['Y0']))

But I wish to add a similar list to the queue later but using appendleft, so it can jump ahead of the list. I assumed the following, but had no luck.

NewList = (['S'],['c'],['!10'],['p4'],['o1200'],['i50'],['r30'],['b10'],['d1'],['A', True, 163])
self.CommandList.appendleft(NewList)

Is this even possible with appendleft?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:54:35+00:00Added an answer on May 15, 2026 at 4:54 pm

    I think you want .extendleft here. This will “extend the list” instead of just appending the list as one element.

    z = collections.deque([1,2,3,4])   # [1, 2, 3, 4]
    
    z.appendleft(['bad', 'news'])   # [ ['bad', 'news'], 1, 2, 3, 4 ]
    z.extendleft(['good', 'news'])  # [ 'good', 'news', ['bad', 'news'], 1, 2, 3, 4 ]
    

    If they are getting inserted in reverse, the quick fix is to just reverse the list:

    z.extendleft(reversed(['good', 'news']))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im currently creating a graph for an app, using coreplot and have a problem
Im currently creating a tile-based game for android. Using java via dalvik JVM. im
I'm currently creating an application using the MVC3 framework. I understand how to use
I'm currently creating a web app using Google's oAuth. I was wondering how I
I'm currently creating both the client and server app using ActiveResource for web servicing.
I am currently creating a frontend editor for wordpress using TDO Mini Forms and
I am currently creating a mobile version of my company's site and using it
I am currently creating my first project using Google App Engine in Eclipse. For
I am currently creating an application which signals readiness to other devices using a
Problem: I am currently creating a webpage layout using divs and css rather than

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.