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 Introducing Lists Meet Lists All You Need Is Lists

Okay now let's add the others to the beatles.

Okay now let's add the others to the beatles. Can you please use the method on lists that allows you to add all values from one list to another?

beatles.py
beatles = ["John"]
beatles.append("Paul")
others = ["George", "Ringo"]
nakalkucing
nakalkucing
12,964 Points

Hi Luis! Could you explain what your question is? Thanks in advance. :)

1 Answer

Øyvind Andreassen
Øyvind Andreassen
16,840 Points

The challenge actually gives you the answer in the debugging. This problem requires you to use the extend-method on the lists. I went for the easy solution of just doing the following.

beatles = beatles + others

Which works, but it's not what the challenge wants. The solution that gets accepted is the following on.

beatles = ["John"]
others = ["George", "Ringo"]
# Your code here
beatles.append("Paul")
beatles.extend(others)