Use the class PairOfDice. You must first create a file with that code for the class definition and then write the main program which uses this class.
import random
def_ _ init_ _(self):
self.redDie = 0
self.blueDie = 0
def getRedDie (self):
return self. _ redDie
def getBlueDie (self):
return self. _ blueDie
def roll (self):
self. _ redDie = random.choice(range{1,7})
self. _ blueDie = random.choice(range{1,7})
def sum (self):
return self. _ redDie + self. _ blueDie
(1) Create a file with the code for the class PairOfDice and name it pairOfDice.py. (Note caps and lower case)
(2) Create a main program which first imports pairOfDice (the file)
(3) The main program is a game in which each of two players rolls a pair of dice. The person with the highest tally wins. Include code for a tie.
The main program should use two instances of the class PairOfDice.
(4) You will end up with two files, pairOfDice.py and your main program. Test thoroughly. You may submit either one zip file or the two .py files to the assignment.