List.extend is used to extend list by appending elements from the iterable or list.For and instance a and b are two lists.
a=[‘apple’,’orange’,’mango’]
b=[‘1′,’2′,’3’]
It will append element of list b into a
a.extend(b)
Output: [‘apple’, ‘orange’, ‘mango’, ‘1’, ‘2’, ‘3’]
[…] is always confusion between list.append & list.extend.Lets see an example where a and b are two list as shown […]
[…] List.extend: To extend a […]