Skip to content
Advertisement

Possible to append multiple lists at once? (Python)

I have a bunch of lists I want to append to a single list that is sort of the “main” list in a program I’m trying to write. Is there a way to do this in one line of code rather than like 10? I’m a beginner so I have no idea…

For a better picture of my question, what if I had these lists:

JavaScript

And want to append y and z to x. Instead of doing:

JavaScript

Is there a way to do this in one line of code? I already tried:

JavaScript

And it wont work.

Advertisement

Answer

JavaScript

should do what you want

or

JavaScript

or even

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement