Advertisement
Olegos

sum list

May 29th, 2022
882
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement