diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..35bbedc --- /dev/null +++ b/data.txt @@ -0,0 +1,5 @@ +Молоко 2 +Хлеб 1 +Яблоки 4 +Сыр 3 +Чай 5 \ No newline at end of file diff --git a/script.py b/script.py new file mode 100644 index 0000000..c9ab915 --- /dev/null +++ b/script.py @@ -0,0 +1,9 @@ +with open("data.txt", "r", encoding="utf-8") as file: + lines = file.readlines() + +changed_lines = [line.upper() for line in lines] + +with open("output.txt", "w", encoding="utf-8") as file: + file.writelines(changed_lines) + +print("Файл output.txt создан.") \ No newline at end of file