Using notepad, create a calendar.txt file that contains the following lines See
ID: 3829873 • Letter: U
Question
Using notepad, create a calendar.txt file that contains the following lines
See Dentist
April 20 2017
12:00pm
1:00pm
Do the lawn
April 21 2017
9:00am
9:30am
The above are records from someone's calendar. Each record holds the event's description, date,
start time, and finish time.
Records are separated by blank lines.
Write a Python program that reads the above calendar.txt file into a 2D list. Each row of the list
will hold the full record for an event. Have the program display the 2D list and then provide the
user with the following menu options (the menu must redisplay itself, unless the user chooses to
quit the program):
- Add an event to the list
- Select an event and modify its date
- Select an event and modify its start time or its end time
- Select an event and delete it
- Exit the program (be sure to save the list before exiting)
We will need to code a function for each of the above options. So the app will have five
functions, in addition to main(). The headers of these functions might look like this
def addEvent(
must be done in python
Explanation / Answer
I am working on it. I have written the starting code. As soon as i am finish , i will update the code here. Thankyou!!
def printmenu():
print("- 1.Add an event to the list"
" 2.Select an event and modify its date"
" 3.Select an event and modify its start time or its end time"
" 4.Select an event and delete it"
" 5.Exit the program (be sure to save the list before exiting")
def addEvent():
pass
def modDate():
pass
def modTime():
pass
def delete():
pass
while True:
ch=int(input("Enter the choice: "))
if ch==1:
addEvent()
elif ch==2:
modDate()
elif ch==3:
modTime()
elif ch==4:
delete()
elif ch==5:
break
else:
print("Invalid choice!! please select option from menu.")
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.