Which of The Following Functions Changes The Position of File Pointer and Returns Its New Position
Which of The Following Functions Changes The Position of File Pointer and Returns Its New Position
Which of the following functions changes the position of file pointer and returns its new
position? a.flush() b.tell() c.seek() d.offset()
2. Write a function in Python to read a text file, Alpha.txt and displays those lines which
begin with the word ‘You’.
3. Write a function, vowelCount() in Python that counts and displays the number of vowels in
the text file named Poem.txt.
4. Vedansh is a Python programmer working in a school. For the Annual Sports Event, he has
created a csv file named Result.csv, to store the results of students in different sports
events. The structure of Result.csv is:
Result is result of the game whose value can be either 'Won', 'Lost' or 'Tie'
For efficiently maintaining data of the event, Vedansh wants to write the following user defined
functions:
Accept() – to accept a record from the user and add it to the file Result.csv. The column headings
should also be added on top of the csv file.
wonCount() – to count the number of students who have won any event. As a Python expert,
help him complete the task.