Question: import unittest import random def random _ shuffle ( values ) : return a new list of the given values in random
import unittest
import random
def randomshufflevalues:
return a new list of the given values in random order"""
newvalues listvalues
random.shufflenewvalues
return newvalues
def brokenshufflevalues:
this doesn't actually shuffle anything!"""
return listvalues
def brokenshufflevalues:
this returns a single instance of each value, shuffled"""
newvalues listsetvalues
random.shufflenewvalues
return newvalues
def brokenshufflevalues:
this always returns the values sorted"""
return listsortedvalues
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
