Question: ***PYTHON*** 1. Write a script that allows the user to roll five dice. They will have two turns. On the first turn, they roll all

***PYTHON***

1. Write a script that allows the user to roll five dice. They will have two turns. On the first turn, they roll all five dice and then set one aside, keeping that die's value. Then, they roll the remaining 4 dice. Their final score is the sum of all 5 dice (the one they saved and the 4 they rolled in their second turn).

Output would look like:

 Hit enter to roll You rolled Die 1: 1 Die 2: 5 Die 3: 3 Die 4: 6 Die 5: 1 Which die would you like to keep? 4 You saved die 4 with a value of 6 Hit enter to roll the remaining dice You rolled Die 1: 2 Die 2: 2 Die 3: 3 Die 4: 3 Your total score is 16

2. Write a script where the user rolls 4 dice on time. They win if at least two dice have the same value. They lose if all the dice have different values. Example:

Hit enter to roll You rolled 4,3,1,5 You Lose

Another example:

Hit enter to roll You rolled 2,1,4,2 YOU WIN!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!