PY DOUBT | Sololearn: Learn to code for FREE!

+10

PY DOUBT

What is the function to randomize the items of a list in-place? kindly do elaborate it with an example which could be easier to understand the concept.

10/8/2020 3:58:54 PM

Hardik

2 Answers

New Answer

+6

random.shuffle() https://code.sololearn.com/cT69eC6uxWvl/?ref=app

0

from random import shuffle i = [0,1,2,34,5,6,7,8,9] shuffle(i) print(i)