Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions