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__":