Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

shuffle function in python

# import the random module
import random
 
# declare a list
sample_list = ['A', 'B', 'C', 'D', 'E']
 
print("Original list : ")
print(sample_list)
 
# first shuffle
random.shuffle(sample_list)
print("
After the first shuffle : ")
print(sample_list)
 
# second shuffle
random.shuffle(sample_list)
print("
After the second shuffle : ")
print(sample_list)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #shuffle #function #python
ADD COMMENT
Topic
Name
5+4 =