Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list1 = [1,3,4,5,9,13]
- list2 = [2,10,12]
- out = []
- while len(list1) and len(list2):
- if list1[0] < list2[0]:
- out += [list1[0]]
- list1 = list1[1:]
- else:
- out += [list2[0]]
- list2 = list2[1:]
- out += list1 + list2
- print out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement