From e21975573b173ccd4a20331d504e1f79585d5213 Mon Sep 17 00:00:00 2001 From: tenshi Date: Wed, 17 Jun 2026 22:11:12 +0300 Subject: [PATCH] Solution py-create-file-from-input --- app/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index 1b70596b..e76fa0a3 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,12 @@ -def main(): - # write your code here - pass +def main() -> None: + file_name = input("Enter name of the file: ") + full_file_name = file_name + ".txt" + with open(full_file_name, "w") as file: + while True: + words = input("Enter new line of content: ") + if words == "stop": + break + file.write(words + "\n") if __name__ == "__main__":