num = [4, 22, 6,
9, 15, 13,
3, 51, 37]
print(num)
for i in range(9):
for j in range(8-i):
n, p = num[j+1], num[j]
if p > n:
num[j], num[j+1] =n, p
print(num)
print('\n')
# илүү хялбар буюу sort() метод ашиглах
num = [4, 22, 6,
9, 15, 13,
3, 51, 37]
print(num)
num.sort()
print(num)
No comments:
Post a Comment