Given the task to sort the numbers in the list without the built-in functions sort , max and sorted . And you need to use the function given below. I tried to do it in this way, but failed:
def max_num(num): j = 0 for i in num: if j < i: j = i return j def min_num(num): h = 1 for i in num: if h > i: h = i return h lst = [2,235,654,4346,754,32,1] k = max_num(lst) g = min_num(lst) spisok = lst[g:k] print(spisok) print(g, k)