Codecademy problem#5 "Combine Sort"
def combine_sort(lst1, lst2):
combined = lst1 + lst2
return combined.sort()
print(combine_sort([1,3,2],[3,1,2]))
This code outputs
none
>Solution :
You could try this instead (once you realize the subtle difference between sorted(L) and L.sort()).
>>> def combined_sort(L1, L2):
return sorted(L1 + L2)
>>> L1 = [1, 3, 2]
>>> L2 = [5, 9, 6]
>>> combined_sort(L1, L2)
[1, 2, 3, 5, 6, 9]
>>>