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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!