How to randomize the items of a list in Python?
Answers
Answered by
0
To use shuffle, import the Python random package by adding the line import random near the top of your program. Then, if you have a list called x, you can call random.shuffle(x) to have the random shuffle function reorder the list in a randomized way.
Similar questions
Social Sciences,
6 months ago
English,
6 months ago
Economy,
1 year ago
Math,
1 year ago
Science,
1 year ago