Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the previous exercise, you used rand ( ) , that generates a random float between 0 and 1 . As Hugo explained in the
In the previous exercise, you used rand that generates a random float between and
As Hugo explained in the video you can just as well use randint also a function of the random package, to generate integers randomly. The following call generates the integer or randomly. is not included.
import numpy as np
nprandom.randint
NumPy has already been imported as np and a seed has been set. Can you roll some dice?
Instructions
XP
Use randint with the appropriate arguments to randomly generate the integer or This simulates a dice. Print it out.
Repeat the outcome to see if the second throw is different. Again, print out the result.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started