Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

zip function python

foo = [1, 2, 3]
bar = [4, 5, 6]

parallel_sum = []
for f, b in zip(foo, bar):
    print(f, b)
    parallel_sum.append(f + b) 
    
print(parallel_sum)
# 1	4
# 2	5
# 3	6
# [5, 7, 9]
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #zip #function #python
ADD COMMENT
Topic
Name
1+4 =