Question: For python 2 programming Question 3. Consider the following Die class inside the file die.py die.py Simple Die class that allows for any number
For python 2 programming
Question 3. Consider the following Die class inside the file die.py "" die.py Simple Die class that allows for any number of sides""" from random import cardinti class Die: "" "Simple Die class that allows for any number of sides"" def_init_(self, *w9s) : "Constructor for any sided Die that takes an the number of sides as a parameter; if no parameter given then default is 6-sided." if leo lacos) == 0: selboursides - 6 elit Lenlaces) -- i and isiostaoce (as980), int): self. _byvsides - args[0] else: print "Usage: Died) or Die (ouwberofsides)" return self current Bosh - raodint(1, self._bunSides) def_str__(self): Overrides the standard method, converts a Die to a string""" return str(self_currentbatt) (self, obsDi) : _SUR_' operator for Dies, to allow for a deep comparison of two Dice"." if self._cuocentsath
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
