Important Notice:

List Concatenation

List Concatenation

6 views 1 min read
List Concatenation :-

Python में List Concatenation का अर्थ है दो या दो से अधिक Lists को जोड़कर एक नई List बनाना। List Concatenation के लिए + operator का उपयोग किया जाता है।

English

List Concatenation means joining two or more lists to create a new list. The + operator is used for list concatenation.

Syntax:-

list3 = list1 + list2

Example:-

list1 = [10, 20, 30]

list2 = [40, 50, 60]

result = list1 + list2

print(result)

Output:-

[10, 20, 30, 40, 50, 60]

Because:-

यहाँ + operator ने list1 और list2 के सभी elements को क्रम से जोड़ दिया।

list1 → [10, 20, 30]

list2 → [40, 50, 60]

list1 + list2 → [10, 20, 30, 40, 50, 60]

English

Here, the + operator joins the elements of list1 and list2 in sequence and creates a new list.

Example with Strings:-

list1 = ["A", "B"]

list2 = ["C", "D"]

result = list1 + list2

print(result)

Output:-

['A', 'B', 'C', 'D']

Important Point :-

List Concatenation में original Lists automatically change नहीं होतीं। + operator एक नई List create करता है।

In Short :-

List Concatenation → + operator की सहायता से दो या दो से अधिक Lists को जोड़ना।

Related Notes