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 trialKaty Teague
1,371 PointsTask 2 doesn't like task 1!
When I am on challenge 1 it says I have completed the task but when I add in the task 2 code it then says task 1 is wrong...but no one told task 1 that!
the_list = ["a", 2, 3, 1, False, [1, 2, 3]]
# Your code goes below here
3 Answers
Kenneth Love
Treehouse Guest TeacherCan you show us your code? Generally, task 1 failing after task 2 is submitted means that your code for task 2 either changed the code that passed task 1 or introduced some breaking/wrong code that causes task 1 to no longer be able to run.
Every previous task is run when you submit an answer for the current task.
Katy Teague
1,371 PointsI thought I attached this sorry! I'm getting myself confused with this, when I run task 1 it runs but when I add the bottom 3 lines it stops accepting it. It's probably me and a syntax error.
the_list = ["a", 2, 3, 1, False, [1, 2, 3]]
# Your code goes below here
the_list.insert(0, the_list.pop(3))
del my_list[0]
my_list.remove("False")
del my_list[3]
Kenneth Love
Treehouse Guest TeacherI'm gonna walk through your code and comment what'll be in the_list
at each step. You can check this out yourself by clicking the "Preview" button in the code challenge.
the_list = ["a", 2, 3, 1, False, [1, 2, 3]]
# Your code goes below here
the_list.insert(0, the_list.pop(3)) # [1, "a", 2, 3, False, [1, 2, 3]]
del my_list[0] # ["a", 2, 3, False, [1, 2, 3]]
my_list.remove("False") # ["a", 2, 3, [1, 2, 3]]
del my_list[3] # ["a", 2, 3]
So, Task 1 was to move the 1 to the front of the list and Task 2 required you to get rid of the "a", False, and extra list. Do you see why Task 1 is no longer passing?
Katy Teague
1,371 Pointsplease do not even dignify this with an answer. I've realise my dopey mistake...blame it on the LONG day!!
Kenneth Love
Treehouse Guest TeacherHa, too late! :)
Glad you figured it out!
Katy Teague
1,371 PointsThank you! Also helps when you get the list name right XD