From 7fa6e59ef4902b1d3b3a860e2c7b5acb0b9b2d1f Mon Sep 17 00:00:00 2001 From: Ensenkei Date: Wed, 24 Jun 2026 12:46:31 +0300 Subject: [PATCH] 'Solution' --- app/main.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 1b70596b..7a21ebd7 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,18 @@ -def main(): - # write your code here - pass +def main() -> None: + file_name = input("Enter name of the file: ") + full_file_name = file_name + ".txt" + + lines = [] + + while True: + user_input = input("Enter new line of content: ") + if user_input == "stop": + break + lines.append(user_input) + + with open(full_file_name, "w") as file_to_create: + for line in lines: + file_to_create.write(f"{line}\n") if __name__ == "__main__":