📄️ A
The Python code reads the content of a text file, "file1.txt," and displays it in the console, illustrating the essential steps of file handling in Python.
📄️ B
This Python code creates a new text file, "file2.txt," and writes the text "Welcome to BELAGAVI" into it using the 'open()' function with write mode ('w') and the 'write()' method. Proper file closure is ensured. The resulting content within "file2.txt" is "Welcome to BELAGAVI," illustrating the file creation and writing process in Python.
📄️ C
The Python code effectively opens a file named "file3.txt" in append mode ("a+"), allowing both reading and appending to an existing file or creating a new one if it doesn't exist. It uses the 'write()' method to append the specified text to the end of the file. Proper file closure is ensured using the 'close()' method. The result is the addition of the text "This is the string text written by my program in file3.txt" to the file "file3.txt," illustrating the file handling process in Python.