python code for dice systems