Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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 Value

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

1. Identify what positions are included in the plan.

Answered: 1 week ago

Question

2. Identify the employees who are included in the plan.

Answered: 1 week ago

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago