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 trial
Margaret Stein
4,413 PointsPython Basics Shopping List-- stuck on code challenge
I'm stuck on step 3 of this code challenge. It says I have the first two steps correct as I do them. Then when I enter my answer to step 3 as shown below, it says "Oops, it looks like Task 1 is no longer passing." I've gone back and repeated Task 1 & 2 and they both pass... until I enter step 3 as below. I've run this program with print statements in Idle Python 3.41 and it works fine. What am I doing wrong??
- full_name = 'My Name' name_list = full_name.split( )
greeting_list = "Hi, I'm Treehouse".split( )
name_list[0] = greeting_list[2]
1 Answer
Chris Freeman
Treehouse Moderator 68,468 PointsYou are so close! Reverse your last statement:
greeting_list[2] = name_list[0]
Margaret Stein
4,413 PointsMargaret Stein
4,413 PointsSeriously? Thank you! I find the "hints" they give you generally uniformative. Don't know if it's my lack of understanding, or that they are just vague. I still do not understand how Task 1 can pass, then by adding a line of code it then fails. Especially when it offers you the chance and go back to Task 1. Also, why would this work in Idle Python but not here? Thank you so much for your help.
Chris Freeman
Treehouse Moderator 68,468 PointsChris Freeman
Treehouse Moderator 68,468 PointsWhen an earlier task starts failing it is usually caused by a syntax error in the current task. When a syntax error is present all tasks "fail". So review your code, perhaps commenting out troublesome lines to identify which line has the syntax error. Getting back to "Bummer!" on the current task is the first step.
Margaret Stein
4,413 PointsMargaret Stein
4,413 PointsThank you for your help and insight! I really appreciate the comments, thanks for taking the time to explain.