]> Skullheadx's Git Forge - Sorting.git/commitdiff
Create utils.py
authorSkullheadx <704277@pdsb.net>
Tue, 24 Jan 2023 23:18:23 +0000 (18:18 -0500)
committerSkullheadx <704277@pdsb.net>
Tue, 24 Jan 2023 23:18:23 +0000 (18:18 -0500)
sorting_algorithms/utils.py [new file with mode: 0644]

diff --git a/sorting_algorithms/utils.py b/sorting_algorithms/utils.py
new file mode 100644 (file)
index 0000000..d499f80
--- /dev/null
@@ -0,0 +1,4 @@
+def swap(array, index1, index2):
+    get = array[index1], array[index2]
+    array[index2], array[index1] = get
+    return array