Advertisement
Olegos

sum list

May 29th, 2022
1,212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. a = [1, 2, 3]
  2. b = [4, 5, 6]
  3.  
  4. def sum_list(a, b):
  5.     if len(a) == len(b):
  6.         c = []
  7.         for i in range(len(a)):
  8.             c.append(a[i])
  9.             c.append(b[i])
  10.         return c
  11. print(sum_list(a,b))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement