
Rocco Soucie
1,018 PointsPython "Pop Quiz" doesn't accept my answer to my problem.
I am on the "Pop" quiz, and I have done what the program asked, but it keeps telling me that I need to use ".insert" and ".pop", but I did. I have tested it in my workspace, and it works just as it's supposed to. I do not know what it wants from me. Please help!
messy_list = ["a", 2, 3, 1, False, [1, 2, 3]]
messy_list.insert( 0, (messy_list.pop(3)))
# Your code goes below here
1 Answer

Dave StSomeWhere
19,786 PointsYes, your code does work in the REPL which I think is just a little more forgiving than the challenge checker.
Removing extra parenthesis and the space before the zero does get accepted
messy_list.insert(0, messy_list.pop(3))
Rocco Soucie
1,018 PointsRocco Soucie
1,018 PointsI also created a more spread out version that works, but it doesn't accept here.
Code: messy_list = ["a", 2, 3, 1, False, [1, 2, 3]] wrong_number = messy_list.pop(3) messy_list.insert( 0, wrong_number) print(messy_list)