Question: Pythons random module includes a function shuffle(data) that accepts a list of elements and randomly reorders the elements so that each possible order occurs with
Python’s random module includes a function shuffle(data) that accepts a list of elements and randomly reorders the elements so that each possible order occurs with equal probability. The random module includes a more basic function randint(a, b) that returns a uniformly random integer from a to b (including both endpoints). Using only the randint function, implement your own version of the shuffle function.
Step by Step Solution
3.55 Rating (169 Votes )
There are 3 Steps involved in it
Consider randomly swapping ... View full answer
Get step-by-step solutions from verified subject matter experts
