python code

master
CharleneOlsen 4 years ago
commit fa25f4bda0

@ -0,0 +1,13 @@
array = [1, 56, 79, 980, 34, 59, 73, 78, 32, 2, 5, 45, 7, 120]
for a in range(len(array)):
prehodit = False
i = 0
while i < len(array)-1:
if array[i] > array[i+1]:
array[i], array[i+1] = array[i+1], array[i]
prehodit = True
i = i+1
if prehodit == False:
break
print(array)
Loading…
Cancel
Save