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

Creating lists

I'm stack on making my_list challenge help guys

lists.py
my_list = [1,2,3 "perfect", "Tanatswa"]

2 Answers

Eric M
Eric M
11,546 Points

If you insist:

my_list = [1,
           2,
           3,
           "perfect",
           "Tanatswa",
           ["I'm a string, and the first element in the second list",
            "I'm another string, and the second element in the list within a list"]
          ]

Here is what I did....

my_list = [1,2,3, "perfect", " tanatswa", [1, "drey"]]

Thanks a lot....it worked

Eric M
Eric M
11,546 Points

First off, you probably want a comma between 3 and "perfect" in your list.

Secondly, this challenge wants exactly 6 items in a list, with the last item being another list that itself contains 2 items. So after you add your comma to separate the third and fourth elements, you'll want to add in that final list item after "Tanatswa",

Can you write the list for me so that I can get the clear picture