Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
1.7k views
in Computer by (49.6k points)
closed by

Write the use and syntax for the following methods: 

a) open() 

b) read() 

c) seek() 

d) dump()

1 Answer

+1 vote
by (51.9k points)
selected by
 
Best answer

a) open( ) is use for excess file in read, write and append mode . 

Syntax :-

    <variable> = open( <file name> , <mode of open of file >)
   
    or
   
    with open ( <file name> , <mode of open of file > ) as <variable> :
 
b) read() function is use for reading the data of files . 

Syntax :-

    <file>.read( < number of character > )
   
c) seek( ) is use for change the position of pointer . 

Syntax :-
   
    <file object >. seek ( offset [,mode] )
   
d) dump() function is use for writing in binary file. 

Syntax :-
   
    pickle,dump( <object to be written > , < file handle>)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...