Sep-26-2017, 02:36 PM
(This post was last modified: Sep-26-2017, 02:49 PM by sparkz_alot.)
You can create a list with colors and number and use randrange function. Here is the sample program which I tried myself.
import random #import random function input('Press any key to roll your Dice:') color=['Red','Blue','Green','yellow','Pink','Black'] #declaring list of 6 colors of 6 sides. op=random.randrange(1,7) #selecting random number from 1 to 6 op1=random.choice(color) #selecting random color from color list print("Your Dice is",op1,"colour with number",op) #printing the output.