for in range(numberofbirthdays) the year is unimportant for our simulationas long as all birthdays have the same year startofyear datetime date( get random day into the year randomnumberofdays datetime timedelta(random randint( ) birthday startofyear randomnumberofdays birthdays append(birthday return birthdays def getmatch(birthdays) """returns the date object of birthday that occurs more than once in the birthdays list "" if len(birthdays=len(set(birthdays)) return none all birthdays are uniqueso return none compare each birthday to every other birthday for abirthdaya in enumerate(birthdays) for bbirthdayb in enumerate(birthdays[ :]) if birthdaya =birthdayb return birthdaya return the matching birthday display the intro print('''birthday paradoxby al sweigart al@inventwithpython com the birthday paradox shows us that in group of peoplethe odds that two of them have matching birthdays is surprisingly large this program does monte carlo simulation (that isrepeated random simulationsto explore this concept (it' not actually paradoxit' just surprising result ''' set up tuple of month names in order months ('jan''feb''mar''apr''may''jun' 'jul''aug''sep''oct''nov''dec' while truekeep asking until the user enters valid amount print('how many birthdays shall generate(max )' response input('' if response isdecimal(and ( int(response< ) numbdays int(response break user has entered valid amount print( generate and display the birthdays print('here are'numbdays'birthdays:' birthdays getbirthdays(numbdays for ibirthday in enumerate(birthdays) if ! display comma for each birthday after the first birthday print(''end='' project #