Question: https://www.onlinegdb.com/online_python_compiler 1. (5Pts) Writing to Files Create a file whose name is test1.txt and save three lines into the file. Make sure that you close

https://www.onlinegdb.com/online_python_compiler
1. (5Pts) Writing to Files Create a file whose name is test1.txt and save three lines into the file. Make sure that you close the file at the end of your code. You need to use three functions: open, write, and close. There are many types of fruits. I love fruits which contain melon in the name. For example, watermelon and muskmelon are my favorite. 2. (5Pts) Reading from Files Write your code to read and display three lines from the file test 1 .txt. Make sure that you close the file at the end of your code. You need to use three functions: open, read, and close. 3. (10Pts) Reading line by line from Files Write your code to read and display line by line from the file test1.txt when you type the enter key. You need to use three functions: open, input, and close. Line1: There are many types of fruits. Line2: I love fruits which contain melon in the name. Line3: For example, watermelon and muskmelon are my favorite. 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
