Question: 1 . Write a program which can add, read, and delete diary notes. In your program, de fine four functions: a ) addNote ( note

1. Write a program which can add, read, and delete diary notes. In your program, de fine four functions:
a)addNote(note, filename): This function appends the note entered by the user to the file. But before appending the note, the function should concatenate the current date to the note (in dd/mm/yyyy format). Use the datetime module for that. The function takes two arguments: note (str) and filename (str).
b)readDayNote(date, filename): This function should return the notes of the given date as a list. The function takes two arguments: date (str in dd/mm/yyyy format) and filename (str).
c)readAllNotes(filename): This function should return all notes in the file as a list. The function takes one argument: filename (str).
d)deleteNote(date, filename): This function should delete one note of the given date. If there are several notes for the given date, then it should show all of them (as a numbered list) to the user and ask the user to choose one from the list to delete. The chosen note should be deleted. The function takes two arguments: date (str in dd/mm/yyyy format) and filename (str).
Your program should keep prompting the user to choose one of the four operations (add note (a), read day note (r), read allc(s), and delete note (d)) until the user enters end. Here is how it should work:
If the user chooses to add a note, the program should ask the user to enter a note and pass that note to the addNote function.
If the user chooses to read a note of a particular date, then the program asks the user to enter a date and passes that to the readDateNote function and print the returned value.
If the user chooses to read all notes, the program should call the readAllNotes function and print the returned value.
If the user chooses to delete a note, the program should ask a date and pass it to the deleteNote function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!