join lists in Python

 join lists in Python


list can be join in many ways like with the help of “+” operator, with the help of append(), or with the extend() methods. Let’s see an example of it.

Example :-

  1. list1=[1,2,3,4] 
  2. list2=[5,6,7,8] 
  3. print(list1+list2) 
  4. print(list1.append(list2)) 
  5. print(list1.extend(list2)) 

Comments

Popular posts from this blog

Programmingshark index 6

Proassignmenthelp index 12

Proassignmenthelp index 27