Python-100-Days/番外篇/code/test.py

11 lines
314 B
Python
Raw Normal View History

2019-10-19 09:34:50 +08:00
def merge(items1, items2):
items3 = []
index1, index2 = 0, 0
while index1 < len(items) and index2 < len(items2):
if items[index1] < items2[index2]:
items3.append(items1[index1])
index1 += 1
else:
items3.append(items2[index2])
index2 += 1