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

Dotan Sharaby
Dotan Sharaby
652 Points

creating a list

it seems like I don`t understand the question, would appreciate it if someone could shed some light

lists.py
my_list = []
my_list.append(1)
my_list.append(2)
my_list.append(3)
my_list.append("a")
list2 = ["b", "c"]
my_list.extend(list2)
Dotan Sharaby
Dotan Sharaby
652 Points

"This challenge is just meant as a refresher. Create a single new list variable named my_list. Put 3 numbers and 2 strings into it in whatever order you want. For the last member, though, add another list with 2 items in it."

and as a result i get "Bummer: Didn't find the right number of numbers or strings in my_list!"

Dotan Sharaby
Dotan Sharaby
652 Points

I thought I had 6 items tho..?
1,2.3,a,b,c how come its not true?

edited- nvm I succeeded :D Thanks for the help!

1 Answer

Sondre Fjellving
Sondre Fjellving
4,700 Points

Hello! It seems that a small misinterpretation has happened. And you did a great job so far!

To complete the task you need 6 items in my_list. You currently have 5. It is easy to misinterpret this task, I did it too. There has to be 2 string objects BEFORE you add list2.

I would also double check what you have written in the last line of your code. You need to use another method to add list2 to my_list.

I am sure you will figure it out!