mass = [10, 5, 7, 3, 8, 2, 9]
print(mass)
n = len(mass)
for i in range(n):
for j in range(i + 1, n):
if mass[i] > mass [j]:
mass[i], mass[j] = mass[j], mass[i]
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
mass = [10, 5, 7, 3, 8, 2, 9]
print(mass)
n = len(mass)
for i in range(n):
for j in range(i + 1, n):
if mass[i] > mass [j]:
mass[i], mass[j] = mass[j], mass[i]
print(mass)