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

Cheri Watts
Cheri Watts
658 Points

Ooops! Task 1 no longer passing!

full_name="Cheri Watts" name_list=full_name.split() greeting_list=("Hi", "I'm", "Treehouse").split()

greeting_list.py
full_name="Cheri Watts"
name_list=full_name.split()
greeting_list=("Hi", "I'm", "Treehouse").split()

EDIT: Treehouse showed a link to the original task after my first comment. So here's what you should be doing for the final part of the task:

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

You could also use -1 in place of the 2 for the index into greeting_list. -1 would mean the last item, -2 would mean the second-to-last item, and so on.

3 Answers

Hi Cheri

The second part of the challenger asks you to create a list from the string "Hi, I'm Treehouse". You create a list from a string by calling the split method on the string which normally splits the string on spaces or on any other delimiter you specify. The error in your code is your adding parentheses around the string.

list = "firstname lastname".split() # this is how you create a list from a string.
Cheri Watts
Cheri Watts
658 Points

Thank you for your assistance, Andreas. I believe I tried what you suggested and the Ooops! Task 1 no longer passing re-occurred. I don't want to feel this frustrated so this is probably not the option for me to learn Python. I will need Treehouse to exit the beta testing stage if they are in beta testing. I hate to think that they released this program from beta testing without repairing this bug...

:(

Hi Cheri

There is nothing wrong with the challenge at all. The above code was an example to show you how the split method works. This is what the code should look like to pass the first two stages of the challenge.

full_name="Cheri Watts"
name_list=full_name.split()
greeting_list= "Hi, I'm Treehouse".split()

let me know if you need anymore assistance.