This can be easily achieved by using the Shuffle() function from the random library as shown below:
from random import shuffle
List = ['He', 'Loves', 'To', 'Code', 'In', 'Python']
shuffle(List)
print(List)
Output: ['Loves','He' ,'To ,'In', 'Python',’Code']