Answers for "add two list in python"

4

add two list in python

list1 = ["a", "b" , "c"]
list2 = [1, 2, 3]

list1.extend(list2)
print(list1)
Posted by: Guest on May-17-2020
1

python add elements of two lists together

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

for (item1, item2) in zip(list1, list2):
	sum_list.append(item1 + item2)

print(sum_list)
Posted by: Guest on November-28-2020
0

how to add two lists in python

list1 = ["M", "na", "i", "Ke"] 
list2 = ["y", "me", "s", "lly"]
list3 = [i + j for i, j in zip(list1, list2)]
print(list3)
# My name is Kelly
Posted by: Guest on July-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language