Python Python Collections (2016, retired 2019) Lists Removing items from a list

Andrew Bickham
PRO
Andrew Bickham
Pro Student 1,461 Points

messy_list

```pythonmessy_list = ["a", 2, 3, 1, False, [1, 2, 3]]

messy_list.pop(3) messy_list.insert(0,1) messy_list.remove("a") del messy_list[-1] del messy_list[-2] del messy_list[-3] messy_list.remove(False)

so im on the second part of this challenge and I getting a MSG that says
Bummer: You need to move the 1 to the front of the list
Which i cleared already

```lists.py
messy_list = ["a", 2, 3, 1, False, [1, 2, 3]]

messy_list.pop(3)
messy_list.insert(0,1)
messy_list.remove("a")
del messy_list[-1]
del messy_list[-2]
del messy_list[-3]
messy_list.remove(False)

1 Answer

Steven Parker
Steven Parker
172,127 Points

Your task 1 steps did place the 1 in front, but it gets deleted by your task 2 code.

Try printing out messy_list between each step to help you understand what each step is actually doing. I think you will discover that some of the steps are doing something different from what you intended!

I'll bet you can fix it after you've seen that.

Steven Parker
Steven Parker
172,127 Points

Andrew Bickham — Glad to help. You can mark the question solved by choosing a "best answer".
Happy coding!