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 trialMark Tan
6,255 PointsError Msg: Your `name_list`'s last item shouldn't be in your `greeting` variable! Type word for word example Task 4 of 4
Followed numerous examples from the Python forum. Console still views my task 4 as an error. However, the Python Idle 3.4.1 on my PC displays the code as correct.
full_name = "Marky Mark"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse".split()
greeting_list[2] = name_list[0]
greeting = " ".join(greeting_list)
2 Answers
William Li
Courses Plus Student 26,868 PointsHello, Mark Tan
ummm ... That's kinda odd, I don't see any problem with this code either, but the code challenge indeed throws error
Bummer! Your
name_list
's last item shouldn't be in yourgreeting
variable!
Not sure why, may be a bug in the grader? cc Kenneth Love
Update: So I gave it another try, by changing the full_name
variable to full_name = "Mark Tan"
, and everything work without problem. Looks like the grader is only upset about the name Marky Mark
.
Chris Freeman
Treehouse Moderator 68,441 PointsIt looks like the grader is using a re.search
for the last name in the output instead of a match
. A re.match()
would be a better check, or at least a re.search()
with word boundaries.
Mark Tan should get a bounty for finding this bug! Great find.
Mark Tan
6,255 PointsMark Tan
6,255 PointsWilliam, I appreciate the quick reply. Thank you.
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 Pointsno problem, hope you are able to pass the challenge now.