From d16d026672fc1af5859dfa2b8332e5454106420c Mon Sep 17 00:00:00 2001 From: Divlo Date: Wed, 30 Jun 2021 12:34:29 +0200 Subject: [PATCH] feat(solutions): add `sorting-algorithms/python/function` --- .../solutions/python/function/README.md | 3 +++ .../solutions/python/function/solution.py | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 challenges/sorting-algorithms/solutions/python/function/README.md create mode 100644 challenges/sorting-algorithms/solutions/python/function/solution.py diff --git a/challenges/sorting-algorithms/solutions/python/function/README.md b/challenges/sorting-algorithms/solutions/python/function/README.md new file mode 100644 index 0000000..fe1a8a2 --- /dev/null +++ b/challenges/sorting-algorithms/solutions/python/function/README.md @@ -0,0 +1,3 @@ +# sorting-algorithms/python/function + +Created by [@Divlo](https://github.com/Divlo) on 30 June 2021. diff --git a/challenges/sorting-algorithms/solutions/python/function/solution.py b/challenges/sorting-algorithms/solutions/python/function/solution.py new file mode 100644 index 0000000..f5bfc25 --- /dev/null +++ b/challenges/sorting-algorithms/solutions/python/function/solution.py @@ -0,0 +1,11 @@ +from typing import List +import sys + +numbers: List[int] = [] +for value in sys.stdin: + numbers.append(int(value.rstrip('\n'))) + +numbers = numbers[1:] +sorted_numbers = sorted(numbers, key=int) +for number in sorted_numbers: + print(number)