Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using python3 to solve the problem Drop Dead is a game played with dice. Players take turns rolling up to five dice and earn points
Using python3 to solve the problem
Drop Dead is a game played with dice. Players take turns rolling up to five dice and earn points based on the numbers that they roll. If a player rolls a 2 or 5 on any of the dice, those dice are declared "dead" and may not be re-rolled that turn; in addition, the player scores 0 for that roll. Otherwise, if no 2s or 5s are rolled, the player earns points equal to the sum of the values shown on all of the dice. For example, a roll of 6, 1, 3, 6, 3 is worth 19 points; a roll of 4, 1,6, 3, 2 earns 0 points (due to the 2) Complete the score) function, which takes a list of five integer values (representing the values rolled on five ordinary six-sided dice) as its sole argument. If the list contains any 2s or 5s, the function returns 0. Otherwise, the function returns the score for that "hand" of dice. Examples: Function Call score ( 6, 3, 3, 1, 51) 0 score ( 6, 1, 3, 1, 41)15 score ( 4, 1, 2, 4, 4 1) 0 Return ValueStep 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