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 Collections (2016, retired 2019) Lists Creating lists

I'm not sure that I understand the challenge the way it is stated. I can't figure out how to do it. Help!

Please help. I can't seem to figure out what the challenge is asking for. Thanks in advance

lists.py
my_list = [3, 2, 1, contact]+["orange", "banana"]

1 Answer

Louise St. Germain
Louise St. Germain
19,424 Points

Hi Angela,

You're almost there - closer than you think. It's also easier than you probably think - it's not asking you to do any sort of operation. You just literally need to give it a single list containing the following:

  • 3 numbers (which you have)
  • 2 strings (which you have, but put them as items in the same list as your 3 numbers)
  • one list which itself contains 2 items

So rearranging what you already have a bit, your answer will look like:

# three numbers, then two strings, then a list-inside-the-list.
# Put 2 things inside that last list
my_list = [3, 2, 1, "orange", "banana", []]

Up above I have an empty list at the tail end of the big list, but go ahead and put two things inside that empty list (e.g., numbers, strings, whatever), and it should be good to go!

I hope this helps! :-)