You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
338 B
Python
14 lines
338 B
Python
![]()
4 years ago
|
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)
|