From 9615b9e47c212ae22d9d77a29e8b0f5662f6254e Mon Sep 17 00:00:00 2001 From: Neuf Date: Mon, 15 Sep 2025 02:57:13 +0500 Subject: [PATCH] =?UTF-8?q?5-=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Module16/05_sort/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Module16/05_sort/main.py b/Module16/05_sort/main.py index 9b7f69c..a1c1fd7 100644 --- a/Module16/05_sort/main.py +++ b/Module16/05_sort/main.py @@ -1 +1,14 @@ # TODO здесь писать код +sort_this_number = [-67, 4, -3, 0, -5] + +print('Изначальный список:', sort_this_number) + +for i_number in range(len(sort_this_number)-1): + for i_next_number in range(i_number + 1, len(sort_this_number)): + _min = sort_this_number[i_number] # можно обойтись без этих переменных, но код станет не очень читаемым... + _max = sort_this_number[i_next_number] + if _min > _max: + sort_this_number[i_number] = _max + sort_this_number[i_next_number] = _min + +print('Отсортированный список:',sort_this_number) \ No newline at end of file