Computer Science, asked by NahidRehmani, 3 months ago

write one-liner python code to show joining of 2 lists.​

Answers

Answered by rahmanazizur147
0

Answer:

Python Join Two Lists

Join two list: list1 = ["a", "b" , "c"] list2 = [1, 2, 3] list3 = list1 + list2. print(list3) ...

Append list2 into list1: list1 = ["a", "b" , "c"] list2 = [1, 2, 3] for x in list2: list1.append(x) ...

Use the extend() method to add list2 at the end of list1: list1 = ["a", "b" , "c"] list2 = [1, 2, 3] list1.extend(list2)

Answered by Anonymous
29

Answer:

Python Join Two Lists

Join two list: list1 = ["a", "b" , "c"] list2 = [1, 2, 3] list3 = list1 + list2. print(list3) ...

Append list2 into list1: list1 = ["a", "b" , "c"] list2 = [1, 2, 3] for x in list2: list1.append(x) ...

Use the extend() method to add list2 at the end of list1: list1 = ["a", "b" , "c"] list2 = [1, 2, 3] list1.extend(list2)

Similar questions