Question: you will write a program which does the following: Creates two instances of a die (i.e. a pair of dice). It will roll each of

you will write a program which

does the following:

Creates two instances of a die (i.e. a pair of dice).

It will roll each of the dice

It will retrieve the current face-up values of the dice.

It will display each of the dice after they have been rolled.

It will also display the sum of the two dice.

Finally, it will ask you if youd like to roll the dice again. Write this in python, it is similar to the coin class below

you will write a program which does the following: Creates two instances

1 inport randon The Coin elasa sinalates a eoin ehat ean # be flipped. 6 elass Coin: eniEethod initializes the 9sideup data attribute with 'Beads". 10 11 de init lf 12 13 14 15 16 17 10 19 20 21 selt..-side:ap Beads. " The toss nethod generates a randon nanber in tho range of 0 through 1. If the number is o, thea sideup is set to Heads # Otherwise, sidaup is set toTails'. def tosa(self) it 1 ) "Heads. randon. rardint [o, -- self.--aldeup else1 self. ideup-Taile 23 24 25 The get eiaup nethod returns the value 2 reterenced by eideup 27 det get sideuptself) 29 return self.sidoup

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!