diff --git a/data.txt b/data.txt new file mode 100644 index 0000000..e69de29 diff --git a/python_env_practice/.gitignore b/python_env_practice/.gitignore new file mode 100644 index 0000000..d7e4553 --- /dev/null +++ b/python_env_practice/.gitignore @@ -0,0 +1,4 @@ +.venv/ +__pycache__/ +*.pyc +output.txt \ No newline at end of file diff --git a/python_env_practice/data.txt b/python_env_practice/data.txt new file mode 100644 index 0000000..0a043c2 --- /dev/null +++ b/python_env_practice/data.txt @@ -0,0 +1,3 @@ +Иванов +Петров +Сидоров \ No newline at end of file diff --git a/python_env_practice/script.py b/python_env_practice/script.py new file mode 100644 index 0000000..9d8b62a --- /dev/null +++ b/python_env_practice/script.py @@ -0,0 +1,8 @@ +with open('data.txt', 'r', encoding='utf-8') as f: + lines = f.readlines() + +with open('output.txt', 'w', encoding='utf-8') as f: + for line in lines: + f.write(line.strip().upper() + '\n') + +print("Готово, результат в output.txt") \ No newline at end of file