6-задание выполнено

This commit is contained in:
Neuf
2025-09-15 17:30:46 +05:00
parent 462690ae09
commit bd59a5aea2

View File

@@ -7,16 +7,12 @@ def merge_sorted_lists(collection1, collection2):
break break
else: else:
result_collection.append(value2) result_collection.append(value2)
print(result_collection)
result_collection.extend(collection1) result_collection.extend(collection1)
print(result_collection)
result_collection.sort() result_collection.sort()
print(result_collection)
return result_collection return result_collection
# Пример использования: # Пример использования:
list1 = [1, 3, 5, 7, 9, 5] list1 = [1, 3, 5, 7, 9]
list2 = [2, 4, 5, 6, 8, 10] list2 = [2, 4, 5, 6, 8, 10]
merged = merge_sorted_lists(list1, list2) merged = merge_sorted_lists(list1, list2)
print(merged) print(merged)