Extra Practice Problem 10 (External resource)
InvertedSort.py
1 #Write a function called inverted_sort. inverted_should
2 #take as input a list of integers, and return as output a
3 #list with the integers sorted from HIGHEST to LOWEST.
4 #
5 #You may use any sorting algorithm you want: bubble, merge,
6 #insertion, selection, a new sort that you learned on your
7 #own, or even one you created yourself. You may use loops,
8 #or you may use recursion.
9 #
10 #You may not use Python's native list sort or reverse
11 #methods; you must write your own sort.
12
13
14 #Write your function here!
15 def inverted_sort(listt):
16
17
18 listt=[]
19 #The code below will test your function. Feel free to
20 #modify it. As written originally, it will print the list:
21 # [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
22 print(inverted_sort([5, 4, 10, 1, 7, 2, 3, 6, 8, 9]))
23
24
25