Python extend() Method: Usage Guide

You can use the `extend()` method in Python to add elements from one iterable object (such as a list, tuple, dictionary, or set) to another iterable object. Here is a simple example:

list1 = [1, 2, 3]
list2 = [4, 5, 6]

list1.extend(list2)

print(list1)

This will result in:

[1, 2, 3, 4, 5, 6]

Note that the extend() method alters the original list list1 by adding the elements from list2 to it.

bannerAds