The objective of the algorithm is to sort a list scores data in accending, showing its work as it sorts one by one and then prints it out in decending order.
scores = [88,92, 79, 85, 90]
accending_order = []
index = 0
for x in scores:
if len(accending_order) == 0:
accending_order.append(x)
print(accending_order)
else:
for y in range(len(accending_order)):
y = accending_order[y]
if x == y:
continue
elif x>y:
accending_order.append(x)
print(accending_order)
break
elif x<y:
index = accending_order.index(y)
accending_order.insert(index, x)
print(accending_order)
break
its outputing this
[88]
[88, 92]
[79, 88, 92]
[79, 88, 92, 85]
[79, 88, 92, 85, 90]
[90, 85, 92, 88, 79]