I bailed this one real bad, help me through please
messy_list = ["a", 2, 3, 1, False, [1, 2, 3]] for letter in messy_list if letter != 3: item = messy_list.pop(3) messy_list.insert() else letter.insert(0)
Mark Fawcett12,276 Points
Am I right in thinking that you have to move the number 1 to the beginning of the list?
Could you do it like this?
Steven TagawaPython Web Development Techdegree Student 4,021 Points
Mark's got it. The thing about your code is that you're using .insert, but you're not telling it WHAT to insert. You can't just say .insert() or .insert(0) ... if you use insert, you need two arguments, where to insert and what to insert. You popped the fourth item in the list and put it into the variable item, which is great -- but the other lines of your code have no idea that item is what they're supposed to be inserting....