Write a program die_function3.py
that has a die()
function that takes a number n
as a parameter, calculates a random number between 1 and n (inclusive), and returns that number to the main
program where it is printed out.
The main()
program should call the die()
function a few times and print the results so several different random numbers are displayed.
Sample output:
I have rolled a 6-sided die to get the result 3
I have rolled a 20-sided die to get the result 17
I have rolled a 2-sided die to get the result 1