Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python program Could you help me out? def command_add(date, eventdetails, calendar): (str, str, dict) rightarrow str Add event_details to the list at calendar(date) Create date

Python program
Could you help me out? image text in transcribed
def command_add(date, eventdetails, calendar): (str, str, dict) rightarrow str Add event_details to the list at calendar(date) Create date if it was not there date: A string date formatted as "YYYY-MM-DD" event_details: A string describing the event calendar: The calendar database return: empty string calendar = {} command add("2017-02-28", "Python class", calendar) calendar == {'2017-02-28': ['Python class']} True command_add("2017-03-11", "CSCA08 test 2", calendar) calendar == {'2017-03-11': ['CSCA08 test 2'], '2017-02-28':\ ['Python class']} True command_add("2017-03-11", "go out with friends after test", calendar) calendar == {'2017-03-11': ['CSCA08 test 2', \ 'go out with friends after test'], '2017-02-28': ['Python class']} True # YOUR CODE GOES HERE pass def command_show(calendar): r (dict) rightarrow str Returns the list of events for calendar sorted in increasing date order as a string, see examples below for a sample formatting calendar: the database of events def command_add(date, eventdetails, calendar): (str, str, dict) rightarrow str Add event_details to the list at calendar(date) Create date if it was not there date: A string date formatted as "YYYY-MM-DD" event_details: A string describing the event calendar: The calendar database return: empty string calendar = {} command add("2017-02-28", "Python class", calendar) calendar == {'2017-02-28': ['Python class']} True command_add("2017-03-11", "CSCA08 test 2", calendar) calendar == {'2017-03-11': ['CSCA08 test 2'], '2017-02-28':\ ['Python class']} True command_add("2017-03-11", "go out with friends after test", calendar) calendar == {'2017-03-11': ['CSCA08 test 2', \ 'go out with friends after test'], '2017-02-28': ['Python class']} True # YOUR CODE GOES HERE pass def command_show(calendar): r (dict) rightarrow str Returns the list of events for calendar sorted in increasing date order as a string, see examples below for a sample formatting calendar: the database of events

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

=+Trainers from headquarters? Local trainers? Independent trainers?

Answered: 1 week ago