Login and get coding
You are given a list of
operasand a list of
composers. For two given composers find operas (where one of the composers is the author) at which premiere both could have been together (i.e. they both had to be alive). Consider just a theoretical possibility of presence, so omit health condition, traveling problems, resources, and any other problems (excluding death) which could restrict their presence.
The list of
namedtuple('Opera', 'author play date')objects. The list of
composerscontains dictionaries with keys => composer names and values =>
namedtuple('Composer', 'name born died')objects.
operas_both_at_premiere(guest, composers)function. Parameters:guest - one of the composers but not the author of an opera composer - the author of an opera
If the required composer or guest is not in the list of composers, raise a
ValueErrorexception. You can use the
_get_datehelper to convert date strings into
list(or generator) of titles of operas. See the tests for more information.
Note that the list of operas in the Bite is shortened.
https://en.wikipedia.org/wiki/List_of_operas_by_Wolfgang_Amadeus_Mozart https://en.wikipedia.org/wiki/List_of_compositions_by_Ludwig_van_Beethoven https://en.wikipedia.org/wiki/List_of_works_for_the_stage_by_Richard_Wagner https://en.wikipedia.org/wiki/List_of_compositions_by_Giuseppe_Verdi
Will you be Pythonista #123 to crack this Bite?
Resolution time: ~54 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.0 on a 1-10 difficulty scale.
» Up for a challenge? 💪