Question
Differentiate between the following:
- f = open(‘diary.txt’, ‘r’)
- f = open(‘diary.txt’, ‘w’)
Solution
- diary.txt is opened for reading data.
- diary.txt is opened for writing data.