diff --git a/app/main.py b/app/main.py index 1b70596b..d8f5d8ec 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,15 @@ -def main(): +def main() -> None: # write your code here - pass + file_name = input("Enter name of the file: ") + file_lines = [] + while True: + file_line = input("Enter new line of content: ") + if file_line == "stop": + break + file_lines.append(file_line) + with open(f"{file_name}.txt", "w") as file: + for line in file_lines: + file.write(f"{line}\n") if __name__ == "__main__": diff --git a/hello_world b/hello_world new file mode 100644 index 00000000..ca348bb4 --- /dev/null +++ b/hello_world @@ -0,0 +1,3 @@ +Python is great! +FastApi is becoming popular +What will be with Django in the future? diff --git a/i_am_empty b/i_am_empty new file mode 100644 index 00000000..e69de29b diff --git a/name1 b/name1 new file mode 100644 index 00000000..fef0ff97 --- /dev/null +++ b/name1 @@ -0,0 +1,2 @@ +This is the first line of content +This is the second