Examine the given Python program and select the purpose of the program from…

2023

Examine the given Python program and select the purpose of the program from the following options: F=open('story.txt', 'r+') S=F.read() S=S.upper() F.seek(0) F.write(s) F.close()

  1. A.

    to count the upper case alphabets present in the file

  2. B.

    to convert all alphabets into uppercase in the file /

  3. C.

    to copy only the upper case alphabets from the file

  4. D.

    to remove all lower case alphabets from the file

Attempted by 1657 students.

Show answer & explanation

Correct answer: B

The purpose of this program is to convert the entire text of the file "story.txt" into uppercase and overwrite the file with the uppercase text .

Explore the full course: Rssb Senior Computer Instructor