Shuffling List Function

  • Share this:

Code introduction


Define a function to shuffle the order of the input list.


Technology Stack : random

Code Type : Function

Code Difficulty : Intermediate


                
                    
import random

def shuffle_list(input_list):
    if not input_list:
        return []
    random.shuffle(input_list)
    return input_list                
              
Tags: