Pythons random module includes a function shuffle(data) that accepts a list of elements and randomly reorders the

Question:

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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Data Structures and Algorithms in Python

ISBN: 978-1118290279

1st edition

Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

Question Posted: