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 :-
- list1=[1,2,3,4]
- list2=[5,6,7,8]
- print(list1+list2)
- print(list1.append(list2))
- print(list1.extend(list2))
Comments
Post a Comment