Answers for "extend in python list"

2

list.extend

# languages list
languages = ['French', 'English']

# another list of language
languages1 = ['Spanish', 'Portuguese']

# appending language1 elements to language
languages.extend(languages1)

print('Languages List:', languages)
Posted by: Guest on March-22-2021
0

Python list extend() Method

fruits = ['apple', 'banana', 'cherry']


    cars = ['Ford', 'BMW', 'Volvo']


    fruits.extend(cars)
Posted by: Guest on June-11-2021
-1

what is the use of extend in python

The extend() method adds the specified list elements (or any iterable) to the end of the current list.
Posted by: Guest on November-09-2020

Python Answers by Framework

Browse Popular Code Answers by Language