Question: In python, I'm having a hard time coming up with a code like this: I would like to take any even size list, order the
In python, I'm having a hard time coming up with a code like this: I would like to take any even size list, order the list, subtract the elements and put them in a different list, then return the minimum. for example: 1) mylist= [9,4,1,7]
2) ordered the list nums =[1,4,7,9]
subtract the elements (1-4), (7-9)
3) newList= [3,2] (absolute value)
4) print the lowest number, in this case 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
