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

Task 3 problem with greeting_list and full_name

Hi, with the python code below, I'm having problems how to change the greeting_list with the full_name -

"Hi I'm <"Your first name">

full_name = "Graeme Young"

name_list = ["Graeme", "Young"]

greeting_list = "Hi, I'm []".full_name

I hope someone could help me with this?

Many thanks, Graeme

2 Answers

Hi Graeme, let's recap

full_name is a variable holding a string "Graeme Young"

name_list is a variable holding a list composed of 2 strings "Graeme" and "Young"

greeting_list is a variable that, I guess, should contain a string, but you are assigning the value "Hi, I'm []" and then you are trying to use full_name as if it were a method. So Python is confused.

name_list[0] contains Your first name, see if you can fix your third line with that

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

greeting_list should be a list made from a string using .split() (the same goes for name_list). Then you'll want to use the index of the last item in greeting_list to change what's in that spot with what's in the first index spot of your name_list.