Answers for "python subtract lists"

1

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]
Posted by: Guest on April-28-2021

Code answers related to "python subtract lists"

Python Answers by Framework

Browse Popular Code Answers by Language