Computer Science
Write appropriate statements to do the following:
(a) To open a file named "RESULT.DAT" for output.
(b) To go to the end of the file at any time.
Python Data Handling
1 Like
Answer
(a) To open a file named "RESULT.DAT" for output:file = open("RESULT.DAT")
(b) To go to the end of the file at any time:file.seek(0, 2)
Answered By
1 Like
Related Questions
Write a method in Python to write multiple line of text contents into a text file "mylife.txt".
Write a method in Python to read the content from a text file diary.txt line by line and display the same on screen.
Write a program to add two more employees' details (empno, ename, salary, designation) to the file "emp.txt" already stored in disk.
How are the following codes different from one another?
1.
fp = open("file.txt", 'r') fp.read()
2.
fp = open("file.txt", 'r')