Describe a sorted function by a loop : <p>I have a task. This is a learning task. I successfully solved it. But I have a problem. The problem is that I need to sort the values ​​in the list in descending order without using functions and methods. This needs to be done in a loop (without using sorted(), as I did).</p>

<p>Guys, I honestly looked for a solution to this problem and tried to come up with this solution myself. But I didn’t succeed. Help me please.</p>

<pre><code>import random

spisok = []

for i in range(0,5):
    spisok.append(random.randint(1,25))

print('The following numbers are generated: ')
print(spisok)

sorted_nums = sorted(spisok, reverse=True)

i = 1

last_num = sorted_nums[0]
print('{i} maximum: {maxim}'.format(i=i, maxim=last_num))

for j in range(1, len(sorted_nums)):
    num = sorted_nums[j]
    if num != last_num:
        i += 1
        print('{i} maximum: {maxim}'.format(i=i, maxim=num))

    last_num = num
</code></pre>
