From 5ef167d0eb3d0435ff883252f319eda2b48132f0 Mon Sep 17 00:00:00 2001 From: Architector Date: Fri, 12 Jun 2026 17:35:58 +0300 Subject: [PATCH 1/2] create file --- app/main.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 1b70596b..eabcccd7 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,16 @@ def main(): - # write your code here - pass + file_name = input("Enter name of the file: ") + ".txt" + + lines = [] + + while True: + line = input("Enter new line of content: ") + if line == "stop": + break + lines.append(line) + + with open(file_name, "w", encoding="utf-8") as file: + file.write("\n".join(lines)) if __name__ == "__main__": From 5ed6895146e5bd21d13bb8e69b1642f845b21931 Mon Sep 17 00:00:00 2001 From: Architector Date: Fri, 12 Jun 2026 17:38:27 +0300 Subject: [PATCH 2/2] fixed annotation --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index eabcccd7..23fca99a 100644 --- a/app/main.py +++ b/app/main.py @@ -1,4 +1,4 @@ -def main(): +def main() -> None: file_name = input("Enter name of the file: ") + ".txt" lines = []