Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .oss-upstream
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TheAlgorithms/Python

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not needed or welcome.

4 changes: 4 additions & 0 deletions sorts/gnome_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will crash in doctests as discussed in CONTRIBUTING.md

unsorted = [int(item) for item in user_input.split(",")]
print(gnome_sort(unsorted))