Randomize List Elements

  • Share this:

Code introduction


This function takes a list as an argument and uses the shuffle method from the random library to randomly shuffle the elements of the list.


Technology Stack : Python, random

Code Type : Python Function

Code Difficulty : Intermediate


                
                    
def shuffle_list(input_list):
    import random
    random.shuffle(input_list)
    return input_list                
              
Tags: