Please answer it in Python In order not to forget to wish the birthday of his loved ones, Alzheimer wants to memorize and manage their dates of birth via a computer program in Python. At first, it is assumed that Al has already computerized the birthday dates of his relatives in a dictionary. The keys in this dictionary are the first names of his relatives (it is assumed that no two people with the same first name). The value associated with each key corresponds to the birthday of the corresponding person, in the form of a 3-item list, containing in the order the day, month and year of birth. The day is considered to be an integer between 1 and 31, the month an integer between 1 and 12 and the year of birth an integer between 1900 and 2021. Thus the list [17, 5, 2021] corresponds to the date of May 17, 2021. This may lead to writing dates that do not exist (e.g. [31, 4, 2003]) but this is not addressed in the exercise. Here is an example of a dictionary containing the dates of birth of 5 friends of Al in this format: ddates={'Chiara': [11, 10, 1998], 'Omar': [22, 11, 2001], 'Ingrid': [12, 6, 2002], 'Marc': [27, 8, 1983], 'Youri': [12, 6, 1983]}. Al would like to be able to add new friends to the dictionary of dates of birth. Write a function add_friend that takes the ddates dictionary as an argument and asks the user for information to add a new friend. To do this, we first ask for the first name of the friend to add. If the first name entered already exists in dates, we ask again until we have a first name that is not in dates. We ask then in the agenda, the month and year of birth of the friend to be added.. We will respect the model of the example below: For example: add_friend(ddates) Friend's name: * user types Chiara * This name is already present, start again: * the user types Alicia * Enter day: * user type 40 * Error: the value must be between 1 and 31 Repeat: * user type 13 * Enter month: * user type -5 * Error: the value must be between 1 and 12 Repeat: * user type 5 * Enter year: * user type 1 * Error: The value must be between 1900 and 2021 Repeat: * user type 2001 * #Return => {'Chiara': [11, 10, 1998], 'Omar': [22, 11, 2001], 'Ingrid': [12, 6, 2002], 'Marc': [27, 8, 1983], 'Youri': [12, 6, 1983],’Alicia’: [13, 5, 2001]}.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Please answer it in Python

In order not to forget to wish the birthday of his loved ones, Alzheimer wants to memorize and manage their dates of birth via a computer program in Python. At first, it is assumed that Al has already computerized the birthday dates of his relatives in a dictionary. The keys in this dictionary are the first names of his relatives (it is assumed that no two people with the same first name). The value associated with each key corresponds to the birthday of the corresponding person, in the form of a 3-item list, containing in the order the day, month and year of birth. The day is considered to be an integer between 1 and 31, the month an integer between 1 and 12 and the year of birth an integer between 1900 and 2021. Thus the list [17, 5, 2021] corresponds to the date of May 17, 2021. This may lead to writing dates that do not exist (e.g. [31, 4, 2003]) but this is not addressed in the exercise. Here is an example of a dictionary containing the dates of birth of 5 friends of Al in this format:

ddates={'Chiara': [11, 10, 1998], 'Omar': [22, 11, 2001], 'Ingrid': [12, 6, 2002], 'Marc': [27, 8, 1983], 'Youri': [12, 6, 1983]}.

Al would like to be able to add new friends to the dictionary of dates of birth. Write a function add_friend that takes the ddates dictionary as an argument and asks the user for information to add a new friend. To do this, we first ask for the first name of the friend to add. If the first name entered already exists in dates, we ask again until we have a first name that is not in dates. We ask then in the agenda, the month and year of birth of the friend to be added.. We will respect the model of the example below:

For example:

add_friend(ddates)

Friend's name: * user types Chiara *

This name is already present, start again: * the user types Alicia *

Enter day: * user type 40 *

Error: the value must be between 1 and 31

Repeat: * user type 13 *

Enter month: * user type -5 *

Error: the value must be between 1 and 12

Repeat: * user type 5 *

Enter year: * user type 1 *

Error: The value must be between 1900 and 2021

Repeat: * user type 2001 *

#Return =>

{'Chiara': [11, 10, 1998], 'Omar': [22, 11, 2001], 'Ingrid': [12, 6, 2002], 'Marc': [27, 8, 1983], 'Youri': [12, 6, 1983],’Alicia’: [13, 5, 2001]}.

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY