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 trialtink3r
1,787 PointsTask evaluator not working.
This should work but the evaluator says it doesn't pass. Anyone know why?
states = [ 'ACTIVE', ['red', 'green', 'blue'], 'CANCELLED', 'FINISHED', 5, ] states.remove(['red', 'green', 'blue'])
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]
states.remove(['red', 'green', 'blue'])
8 Answers
matth89
17,826 PointsThis challenge wants you to remove the last item in the list (5) on the first step. On step two you'll remove the nested list of colors.
tink3r
1,787 PointsI was on step 2.
matth89
17,826 PointsDid you happen to delete your line of code from step 1? What message did it give you?
tink3r
1,787 PointsUnfortunately there is no way to add a screenshot but I assure you step 2 is where I am at.
tink3r
1,787 PointsStep 1 passed fine. Step 2 says this... Challenge Task 2 of 2 OK, one more removal. See that second item in states? It's a list of colors and doesn't belong here. Can you get rid of it for me? Be sure to use .remove() again. With the code given it should work. I think it's a bug. Hopefully not.
matth89
17,826 PointsI just went through the challenge using the same line you posted, as well as the line for deleting the number 5 from the list, and it passed just fine. What is the message being displayed when it fails?
tink3r
1,787 PointsThere error is... Oops! It looks like Task 1 is no longer passing. Maybe i'll clear my cache and try again later or something. Seems the code is fine.
matth89
17,826 PointsWhat I'm saying is that you still need the line of code from the first step in there in order to pass step 2. I'm not seeing it in your code you posted.
matth89
17,826 PointsThis is what I used. You need both 'remove' calls in there.
states = [
'ACTIVE',
['red', 'green', 'blue'],
'CANCELLED',
'FINISHED',
5,
]
states.remove(5)
states.remove(['red', 'green', 'blue'])
tink3r
1,787 Pointsoic, I'm with you now. Didn't realize that.