From b955427a18ef2590b27838b841f283b8ea39c974 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Tue, 30 Jun 2026 20:35:34 +0530 Subject: [PATCH 1/2] Add testmod() call to gnome_sort.py main block for consistency --- sorts/gnome_sort.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sorts/gnome_sort.py b/sorts/gnome_sort.py index ea96e0a926a3..5d5b13efba13 100644 --- a/sorts/gnome_sort.py +++ b/sorts/gnome_sort.py @@ -51,6 +51,10 @@ def gnome_sort(lst: list) -> list: if __name__ == "__main__": + from doctest import testmod + + testmod() + user_input = input("Enter numbers separated by a comma:\n").strip() unsorted = [int(item) for item in user_input.split(",")] print(gnome_sort(unsorted)) From 02d2943f291396022c27aef18bceba49f3473ae4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:14:50 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- sorts/gnome_sort.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorts/gnome_sort.py b/sorts/gnome_sort.py index 5d5b13efba13..b3f3f53adbf8 100644 --- a/sorts/gnome_sort.py +++ b/sorts/gnome_sort.py @@ -54,7 +54,7 @@ def gnome_sort(lst: list) -> list: from doctest import testmod testmod() - + user_input = input("Enter numbers separated by a comma:\n").strip() unsorted = [int(item) for item in user_input.split(",")] print(gnome_sort(unsorted))