Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python subtract lists

# Example usage using list comprehension:
list_a = [1, 2, 3]
list_b = [1, 1, 1]
[a_i - b_i for a_i, b_i in zip(list_a, list_b)]
--> [0, 1, 2]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #subtract #lists
ADD COMMENT
Topic
Name
9+2 =