'r': open an ____ file for a read operation. ____: open an existing file for a write operation. If the file already contains some data, then it will be ____ but if the file is not present then it creates the file as well. 'a': open an existing file for ____ operation. It won’t override existing data. file = open("geeks.txt", "r"): You start by opening a file and specify what ____ you need it in out of the above. print (file.read(5)): This reads 5 ____ from a file. print (file.readlines()): This would read everything from a file and return it as a ____. print (file.____: This would return one line from a file. file.close(): It is best practice to ____ a file once you are done.

Leaderboard

Visual style

Options

Switch template

Continue editing: ?