Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def combine(list1, list2):
- listkq=[]
- templ1,templ2=0,0
- for i in range (len(list1)+len(list2)):
- if i%2:
- listkq.append(list2[templ2])
- templ2+=1
- else :
- listkq.append(list1[templ1])
- templ1+=1
- return listkq
- listkq=combine(['a', 'b', 'c'] ,[1, 2, 3])
- print(listkq)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement