Random Shuffle List Function

  • Share this:

Code introduction


This function takes a list as input, shuffles it randomly, and returns the shuffled list.


Technology Stack : random

Code Type : Function

Code Difficulty : Intermediate


                
                    
import random

def shuffle_list(items):
    return random.sample(items, len(items))                
              
Tags: