Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python Days of the Week Function Name: days_of_the_week() Parameters: list of birthdays ( list ), year (int ) Returns: list of names ( list )
python
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started