-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
Description
Describe the bug
The test tries to compare two randomized lists, and passes if they are the same.
Even with the proposed solution, the test does not pass 2/2
To Reproduce
Use the proposed solution, and run the cell:
`def solution_randomize_list(my_list: list[int]) -> list[int]:
"""
A function that randomizes the order of the elements in a list.
Args:
my_list: A list of integers
Returns:
- A new list with the elements of `my_list` in random order
"""
return sorted(my_list, key=lambda x: random.random())`
Expected behavior
The test should pass with 2/2 green. However, since it compares random lists with each other, the passing rate is also random.