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

Python Python Basics (Retired) Shopping List Lists and Strings

Jim Bowker
Jim Bowker
2,349 Points

Im's stuck on challenge 4/4 on shopping list. I have first 3 lines correct.

Bummer! NameError: name 'greeting' is not defined | x = y I know it probally means I haven't set a value for x or y variables. Can you give me a nudge in the right direction? Thanks

greeting_list.py
full_name = "James Romily Bowker Jr"
name_list = full_name .split(" ")
greeting_list = "Hi, I'm James Romily Bowker Jr".split(" ")
greeting_list[name_list] = name_list[full_name]

2 Answers

Jim Bowker
Jim Bowker
2,349 Points

I must be lost, or maybe my headache I changed to this. I'm sure it's something simple I'm over looking. full_name = "James Romily Bowker Jr" name_list = full_name .split(" ") greeting_list = "Hi, I'm James Romily Bowker Jr".split(" ") greeting = greeting_list .join() output = Bummer! AttributeError: 'list' object has no attribute 'join'

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Lists don't have a .join() method, strings do. You provide what you want between each item in the string, and then the list. So, if you wanted greeting_list to be joined together with an underscore, you'd use "_".join(greeting_list).