Answers for "python add elements of two lists together"

1

calculate the addition of two lists in python

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

# `zipped_lists` contains pairs of items from both lists.
# Create a list with the sum of each pair.
sum = [x + y for (x, y) in zip(list1, list2)] 

print(sum)
# [5, 7, 9]
Posted by: Guest on December-20-2020
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
3

append two list of number to one python

listone = [1,2,3]
listtwo = [4,5,6]
mergedlist = []
mergedlist.extend(listone)
mergedlist.extend(listtwo)
Posted by: Guest on February-17-2020

Code answers related to "python add elements of two lists together"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language