From 4bf261eb6f020ed8010976071fb2d49df6e0b48d Mon Sep 17 00:00:00 2001 From: Nischay mrzn <129774293+Nischaymrzn@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:07:11 +0545 Subject: [PATCH] Create write_to_file.py --- Python/write_to_file.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Python/write_to_file.py diff --git a/Python/write_to_file.py b/Python/write_to_file.py new file mode 100644 index 0000000..209468a --- /dev/null +++ b/Python/write_to_file.py @@ -0,0 +1,3 @@ +def write_to_file(filename, content): + with open(filename, 'w') as file: + file.write(content)