This repository has been archived on 2025-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
python_it_top/02-10/practica.py
it-top f9abd0c48c add
2025-10-02 12:31:48 +05:00

14 lines
501 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import random
N = 10
list_sort_buble = []
for _ in range(N):
list_sort_buble.append(random.randint(0,100))
print(f"Не сортированный список: {list_sort_buble}")
# Сортировка пузырьком
for i in range(N):
for j in range(N - 1 - i):
if list_sort_buble[j] > list_sort_buble[j+1]:
list_sort_buble[j], list_sort_buble[j+1] = list_sort_buble[j+1], list_sort_buble[j]
print(f"Отсортированный список: {list_sort_buble}")