Question: In python.. If we want the computer to pick a random number in a given range say to write code for Picking a random element
In python..


If we want the computer to pick a random number in a given range say to write code for Picking a random element from a list or pick a random card from a deck, flip a coin etc. we can use Random module The Random module contains some very useful functions one of them is randrange() randrange(start, stop) Example from random import randrange for i in range (3): print ("printing a random number using randrange(1, 7)",r andrange(1, 7)) The above code when executed will give a random number between 1 and 7. printing a random number using randrange (1, 7)6 printing a random number using randrange (1, 7)5 printing a random number using randrange (1,7)4 Assignment 3 30 Marks Using the above function randrange().Please write a program that simulates roll of two dices You need to write a function call showdice(arg1) that takes an ar gument in between 1 and 6 and prints the face of dice as show by the execution of the program below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
