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

Shadow Skillz
Shadow Skillz
3,020 Points

Challenge Task 3 of 4 change "Treehouse" in greeting_list to the first item in your name_list variabl

full_name = ('Big Billy') name_list = (full_name.split()) greeting_list = ("Hi, I'm Treehouse".split()) 'greeting_list'.join(name_list)

greeting_list.py
full_name = ('Big Billy')
name_list = (full_name.split())
greeting_list = ("Hi, I'm Treehouse".split())
'greeting_list'.join(full_name)

1 Answer

Hi Christian,

You're doing great. Let's consider what the challenge is asking us.

change "Treehouse" in greeting_list to the first item in your name_list variable.

# greeting_list is a list of strings, that when printed, will look like this:
["Hi,", "I'm", "Treehouse"]

# name_list is a list of strings, that when printed, will look like this:
["Big", "Bill"]
  • What is the index position of "Treehouse" in greeting_list?
  • What is the index position of the first item in your name_list?
# since "Treehouse" is the 3rd element in greeting_list, it's index position is 2,
# because indexes start counting from 0

# since the first item is the 1st element in name_list, it's index position is 0

# now we have all the information we need and can change greeting_list.
greeting_list[2] = name_list[0]

Please let me know if this was helpful or not.

Kind Regards

Shadow Skillz
Shadow Skillz
3,020 Points

Hi Robert,

Thank you for your help and the speedy response I really appreciate that.

lol now that I sit back and look at it. IT makes perfect sence and I feel like a real Tool

:-) Thanks again bro

My pleasure. Please mark this as 'Best Answer' to help others who may be looking for help with the same problem.

Cheers!