From 05a8044f7acbe86cc505808743274497af22e92f Mon Sep 17 00:00:00 2001 From: Illia Fedoruk Date: Thu, 18 Jun 2026 16:18:25 +0300 Subject: [PATCH] Completed Solution --- app/main.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 1b70596b..678699d2 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,17 @@ -def main(): - # write your code here - pass +def main() -> None: + file_name = input("Enter name of the file: ") + lines = [] + while True: + user_input = input("Enter new line of content: ") + + if user_input == "stop": + break + + lines.append(user_input) + + with open(file_name + ".txt", "w") as text: + for line in lines: + text.write(line + "\n") if __name__ == "__main__":