Here, we are going to build a dice() function using python. The program is so simple as an introductory program for defining a function. The function is going to use an inbuilt library naming random. This random library helps us to choose a random value of the variable within the range.
random.choice([1,2,3,4,5,6])
Code:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer