diff --git a/.gitignore b/.gitignore index 0cafc1c..c136cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.venv/ \ No newline at end of file +.venv/ +output.txt \ No newline at end of file diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..4b9a7c3 --- /dev/null +++ b/data.txt @@ -0,0 +1,12 @@ +13 +8 +11 +25 +1005 +581 +42 +66 +81 +9 +1 +852 \ No newline at end of file diff --git a/script.py b/script.py new file mode 100644 index 0000000..b977872 --- /dev/null +++ b/script.py @@ -0,0 +1,10 @@ +with open('data.txt', 'r') as file: + lines = file.readlines() + +numbers = [int(line.strip()) for line in lines] + +sorted_numbers = sorted(numbers, reverse=True) + +with open('output.txt', 'w') as output_file: + for number in sorted_numbers: + output_file.write(f"{number}\n") \ No newline at end of file