From: Skullheadx <704277@pdsb.net> Date: Tue, 24 Jan 2023 23:18:23 +0000 (-0500) Subject: Create utils.py X-Git-Url: http://git.skullheadx.com/nixos/blog/openbsd_html_css.html?a=commitdiff_plain;h=a35ef06b1013834dded58f060b60115e27c1cbfc;p=Sorting.git Create utils.py --- diff --git a/sorting_algorithms/utils.py b/sorting_algorithms/utils.py new file mode 100644 index 0000000..d499f80 --- /dev/null +++ b/sorting_algorithms/utils.py @@ -0,0 +1,4 @@ +def swap(array, index1, index2): + get = array[index1], array[index2] + array[index2], array[index1] = get + return array