Use these libraries and global variables that should remain immutable (theyre constants) you MUSTuse these constants in your code so if theyre changed, everything will still work as it should. Your codeshould handle four 20-sided die rolled nine times per test just as easily as five 6-sided die rolled threetimes per test Define a class called 3 (singular for dice) that will have the following methods:++ ++0 %) (+%+ 1 creates a 3 object with the given number of sides (forexample, +53061 a normal 6-sided die, or +5301 for a gamers 20-sided die.It should even be able to handle an odd number, such as a 17-sided die! We are not limited by the needfor physical symmetry here. (0 %1 will roll the 3 based on the number of sides and assigns the value rolled to a hiddenvariable a positive integer from 1 to the number of sides. For example, a 6-sided 3 will generate andreturn a value from 1 to 6. Hint: ( ( 0)1 will generate a random integer whosevalue is equally likely to be any integer from 1 through 100, including both 1 and 100.0 %1 will return an integer, the current value of the die as it was last rolled. If the die hasnever been rolled, it should return a value of .Also, in your main code at
the bottom of the Python module, write Python code to create a list called+. whose items are 3 objects. This +. list will represent the dice in your mainexecutable code, and must match the requirements for the +. parameter for the pre-writtenfunctions.Part IIUsing 3 objects as defined above, you will define the function called +>0+.1(much like + 01 in the previous project), that will perform the simulation as specifiedbelow.The function will return =( if the outcome is a Yahtzee, and if it is not.In the game of Yahtzee, a player rolls dice. In your function, the player will try to get a Yahtzee byfollowing these rules:(1) For the first roll, roll all the dice(2) Determine which value is on the most dice, and set those dice aside so they wont be re-rolled(3) Re-roll all the dice that werent set aside(4) Repeat steps (2) and (3) until youre out of rolls (in Yahtzee, its a maximum of 3 rolls)(5) If, after the rolls, all the dice have the same value, you have a Yahtzee! If not, then you dont.Consider the following code to print the values of all your dice to the screen. The parameter +.is a list of 3 objects notice how each die is represented by ^^ this is part of the homework, if u r intrested please let me know thank you