How to append another list at the end of the list


Tue Mar 31 2020 05:18:11 GMT+0000 (UTC)

Saved by @GoByte #python #python #extendfunction

“Extend”  Allow to take a list and append another list at the end of it.
# language list
1.language = ['French', 'English', 'German']

# another list of language
2.language1 = ['Spanish', 'Portuguese']


# Extended List
4.print('Language List: ', language)

When you run the program, the output will be:
Language List:  ['French', 'English', 'German', 'Spanish', 'Portuguese']

Python list extend() is an inbuilt function that adds the specified list elements (or any iterable) to the end of the current list. The extend() extends the list by adding all items of the list (passed as an argument) to an end.