-->

Data File Handling

Question
CBSEENCO12011694

Differentiate between the following:

  1. f = open(‘diary.txt’, ‘r’)
  2. f = open(‘diary.txt’, ‘w’)

Solution
  1. diary.txt is opened for reading data.
  2. diary.txt is opened for writing data.