Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (Retired) Lists Redux Manipulating Lists

reza sajadian
reza sajadian
718 Points

I don't understand what the question wants me to do

the quiz gives me a list, want me to move the first 1 to the beginning of the list in the first level, and in the second level wants me to delete the members of the list: the_list = ["a", 2, 3, 1, False, [1, 2, 3]] So, what I do is as I have written, but its keeps giving me the answer "it looks like Task 1 is no longer passing!" I don't understand what it wants me to do.

Hi reza,

Your code didn't show up in your question. Can you post your code?

1 Answer

Jeffery Austin
Jeffery Austin
8,128 Points

Not sure what your code looks like, so I'm not sure how to show you what is wrong with your code, but here is an example with explanations:

the_list = ["a", 2, 3, 1, False, [1, 2, 3]]

# This will pop 1 out of the_list which is at the index of 3, 
# so the list no longer contains 1 at this point.
# It is stored in the variable one.
one = the_list.pop(3)

# Next we insert the variable one in at the index of 0
the_list.insert(0, one)

# This will remove each of the items the challenge wants us to remove.
# Keep in mind that .remove() does not accept 
# multiple parameters. Also, keep in mind that if you use del
# to delete an index, each time you delete something from 
# the_list the indexes in the_list change so you have to account 
# for that change
the_list.remove("a")
the_list.remove(False)
the_list.remove([1, 2, 3])