Question: I am trying to write a python program to sort the elements in this list in ascending and descending order. I am struggling to figure

I am trying to write a python program to sort the elements in this list in ascending and descending order. I am struggling to figure out how to make the list on the left side (aka the aList.index(item) function) provide a unique count for elements that are repeated in aList. For example, youll see when I run the program, the circled numbers are both 9s and thats because 9 occurs twice in the list; how do I change the input of this program to produce an output with individual indexing for each instance of element 9? I provided a handwritten photo of what I want the output to look like. Thank you!
 I am trying to write a python program to sort the
elements in this list in ascending and descending order. I am struggling
to figure out how to make the list on the left side

Ascending Order 0 -5 1 -4 2 0 3 2 4 3 6 9 6 9 8 11 Descending Order 0 99 2 9 2 9 5 3 6 2 7 0 8 -4 9 -5

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!