Min and Max Swapping

You are required to deliver the following function in the module minmax_swap (file minmax_swap.py):

minmax_swap(l1, l2)

such that

given l1, l2 list s of float not necessarily of the same length.

modifies them both by swapping their values at every position in the range of both, such that the bigger numbers end up in l1 and the smaller ones in l2. The values in positions where only one list is defined should remain unchanged.

For example:


>>> l1 = [1.0, 2.5, 3.8, 0.0, 1.0]
>>> l2 = [2.0, 0.0, 5.0] 
>>> minmax_swap(l1, l2)
>>> l1 == [2.0, 2.5, 5.0, 0.0, 1.0] and l2 == [1.0, 0.0, 3.8]
True

Doctests are available in the minmax_swap.test file.