diff --git a/.gitignore b/.gitignore index 21d0b89..c136cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .venv/ +output.txt \ No newline at end of file diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..a6f422c --- /dev/null +++ b/data.txt @@ -0,0 +1,2 @@ +чипсы 2 +сухарики 4 \ No newline at end of file diff --git a/script.py b/script.py new file mode 100644 index 0000000..ce5615e --- /dev/null +++ b/script.py @@ -0,0 +1,11 @@ + +with open('data.txt', 'r', encoding='utf-8') as file: + lines = file.readlines() + +transformed_lines = [line.upper() for line in lines] + +with open('output.txt', 'w', encoding='utf-8') as file: + for line in transformed_lines: + file.write(str(line) + '\n') + +print("Файл output.txt успешно создан!") \ No newline at end of file