SelectedTargets is shuffled. The function does not return anything it alters the passed in object.
Example
Example
import random selected_targets = [1, 2, 3, 4, 5] random.shuffle(selected_targets) print(selected_targets)
Output:[1, 2, 5, 4, 3]
If you want to keep selected_targets as it is and get a new shuffled list, you can use sample with the full list size.target_pool = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] no_of_targets_to_select = 5 selected_targets = random.sample(target_pool, no_of_targets_to_select) print(selected_targets) sessions2 = random.sample(selected_targets, len(selected_targets)) print(sessions2)
Output:[4, 7, 6, 5, 9]
[9, 4, 6, 7, 5]