From bcc8967a566e0a1661e450c43d4797923e0ac855 Mon Sep 17 00:00:00 2001 From: Sofiia Horokhova Date: Fri, 26 Jun 2026 18:18:53 +0200 Subject: [PATCH] 'Solution' --- app/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 1b70596b..be19345a 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,14 @@ -def main(): - # write your code here - pass +def main() -> None: + name = input("Enter name of the file: ") + lines = [] + while True: + line = input("Enter new line of content: ") + if line == "stop": + break + lines.append(line) + file_name = f"{name}.txt" + with open(file_name, "w") as file: + file.write("\n".join(lines)) if __name__ == "__main__":