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

Viraj Kokane
Viraj Kokane
17,531 Points

Please help! Having trouble with code.

Having trouble with the code. Please help. Any help would be appreciated.

Viraj Kokane
Viraj Kokane
17,531 Points

full_name = "Viraj Kokane" name_list = list(full_name.split)

3 Answers

Have a try with this:

full_name = "Steve Hunter"
name_list = full_name.split()

Steve.

Make sure you use the brackets - they don't apear clearly in the code snippet but they're there!!

Viraj Kokane
Viraj Kokane
17,531 Points

full_name = "Viraj Kokane" name_list = full_name.split() greeting_list = "Hi, I'm Treehouse".split() name_list.append(greeting_list[3])

Viraj Kokane
Viraj Kokane
17,531 Points

Please help with this 3rd challenge!

full_name = "Steve Hunter"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse".split()
greeting_list[2] = name_list[0]

:-)

Viraj Kokane
Viraj Kokane
17,531 Points

Thank you Steve Hunter very much for the help! :)

No problem!

Steve.

And the last part is a little strange. To join a list back together, start with the 'delimiter', i.e. the string that you want to separate the items in the list once you've joined it together. A space is common, for obvious reasons! Then call the join method on that string, passing the list as a parameter:

greeting = " ".join(greeting_list)