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..341826a --- /dev/null +++ b/data.txt @@ -0,0 +1,4 @@ +hello +world +python +123 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1e2d6e7 Binary files /dev/null and b/requirements.txt differ diff --git a/script.py b/script.py new file mode 100644 index 0000000..1e4cc1e --- /dev/null +++ b/script.py @@ -0,0 +1,8 @@ + +with open('data.txt', 'r') as file: + lines = file.readlines() +transformed_lines = [line.strip().upper() for line in lines] +with open('output.txt', 'w') as file: + for line in transformed_lines: + file.write(line + '\n') +print("Данные успешно обработаны и сохранены в output.txt") \ No newline at end of file