Write a Python program to shuffle and print a specified list.

solution:–

from random import shuffle
colour=["red","blue","white","purple","pink"]
shuffle(colour)
print(colour)


Output:-

[‘pink’, ‘blue’, ‘purple’, ‘white’, ‘red’]


Process finished with exit code 0



Leave a Reply

Your email address will not be published.