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

Task 1 No longer passing

Things keep going back to Task 1 no longer passing. I am in Day 2 of the free 14 day trial but it looks like I won't be staying in this school. I guess I can wait 3 or 6 month and more of the kinks will be worked out. I even opted to pay the $490 annually but if every lesson I do invalidates previous Tasks...simply too frustrating! Probably, when Treehouse is out of beta testing, things won't be so frustrating.

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

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

2 Answers

Hi Cheri,

Sorry you're having a bit of a 'mare with this. It can be frustrating at times, yes. Some courses in Treehouse are far more established than others - the Android and iOS tracks, for example, are flawless. Every now and again, though, little issues like this get through. I've come across a few scenarios where "Task 1 is no longer passing" when that's clearly not the case! This is one of those, I am sure.

Unfortunately, my knowledge of Python isn't great so I can solve this one for you ... I will keep trying, though! I got as far as:

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

greeting = greeting_list.join(" ") // <-- wrong! start with the space! 

And, whilst I'm not sure what's wrong with that, there's clearly something wrong with it so I'll go and find out what!

I do recommend Treehouse as a learning tool. I know you might not have had the easiest of introductions to it, but it is on the whole very well presented and an excellent way of learning. And, no, I don't get paid for saying that, or for being here!

I'll be back when I've figured out what I've done wrong with that code ...

Steve.

Got it!!

In the first video it explains that you start the join with the thing that will fill the gaps in the list, i.e. the space. Then the join() function takes the array. So my last line should look like:

greeting = " ".join(greeting_list)

That worked!

Cheri Watts
Cheri Watts
658 Points

Steven,

Thank you! You are truly a hero! I know you may think I am overestimating that but your answer provided me with hope of learning Python and now my desire to weep is subsiding.

The language that I was attempting to learn is Python.

Once again, thank you, Hero!

Keep at it - you're getting on great! There will be tricky bits along the way and hopefully we can get through those challenges on the Community pages. We try to help where we can.

That was my first bit of Python - and that's one weird way of joining an array together. But now I kow, I'll try not to forget.

All these languages are difficult at first. They then get steadily easier as you work through them. THen, switching languages is doable as loads of the same rules apply across them all.

Don't get disheartened - if you get stuck, just ask and the forum will give you an answer. If you still get nowhere, just mention me in your post (use an @, same as Twitter!) and it'll pop up in my inbox. Just like - Steve Hunter Cheri Watts

Keep going!

Steve.