Question: python Days of the Week Function Name: days_of_the_week() Parameters: list of birthdays ( list ), year (int ) Returns: list of names ( list )

python

python Days of the Week Function Name: days_of_the_week() Parameters: list of birthdays

Days of the Week Function Name: days_of_the_week() Parameters: list of birthdays ( list ), year (int ) Returns: list of names ( list ) Description: You and your friends all want to celebrate your birthdays together, but you don't want to stay up late on a school night. Write a function that takes in a list of tuples formatted as (day ( int ), month ( int ), name (string)), and a year ( int ). Use Python's calendar module to find the day of the week that the date falls on in the given year (O being Monday, 6 being Sunday). Return of a list of the names of your friends whose birthday falls on a Friday (4) or a Saturday (5). >>> birthdays = [(28, 2, "Molly"), (19, 3, "Abby"), (4, 9, "Kevin"), (15, 1, "C laudia")] >>> year = 2020 >>> print (days_of_the_week(birthdays, year)) ['Molly', 'Kevin'] >>> birthday = [(10, 11, "Sayler"), (18, 9, "Chad"), (29, 10, "Tammie")] >>> year = 2027 >>> print (days_of_the_week(birthdays, year)) ['Chad', 'Tammie']

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 Databases Questions!