Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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]
Comment

add two list in python

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

list1.extend(list2)
print(list1)
Comment

python how to sum two lists

import numpy as np
np.add(first, second)
Comment

PREVIOUS NEXT
Code Example
Python :: how to know how much lines a file has using python 
Python :: print bold text python 
Python :: bring tkinter window to front 
Python :: split imagedatagenerator into x_train and y_train 
Python :: save ml model using joblib 
Python :: save video cv2 
Python :: python test if value is np.nan 
Python :: serializers.py include all fields 
Python :: how plot graph by using group by function in python 
Python :: lru cache python 
Python :: show image with ratio opencv python 
Python :: how to change colour of rows in csv using pandas 
Python :: count number of rows pandas condition 
Python :: shuffle rows dataframe 
Python :: find matches between two lists python 
Python :: get number of bits on integer in python 
Python :: python how often element in list 
Python :: the four pillars of Op in Python 
Python :: resize multiple images to same size python 
Python :: python print list items vertically 
Python :: change tick labelsize matplotlib 
Python :: mimetype error django react 
Python :: when pyspark 
Python :: import static in django urls 
Python :: python for loop m to n 
Python :: spike python 
Python :: panda - subset based on column value 
Python :: python transpose list 
Python :: django import timezone 
Python :: selenium scroll to element python 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =