Bite 142. Exception Handling: Calculate the Winning Player
Login and get codingComplete the two functions below:
calculate_scoretakes a list of dice rollscoresand returns the total score only taking into account scores of>= MIN_SCORE. If scores contains invalid data (!= DICE_VALUES) raise aValueError.get_winneruses thiscalculate_scorehelper to calculate the winning player from a list ofPlayer namedtuples. However if the players passed in are not having the same number of scores (e.g. all have 4 scores) you should raise aValueErrortoo.See the
docstrings andpytestcode for more info. Keep calm and code in Python, happy Cyber Monday!
Will you be the 133rd person to crack this Bite?
Resolution time: ~31 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 1.67 on a 1-10 difficulty scale.
» You can do it! 😌