You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
edoardob90
changed the title
Issue in test_12_functions_advanced with reference_randomize_list
Issue with exercise "Randomize list" in Functions Advanced
May 10, 2025
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.
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.
The text was updated successfully, but these errors were encountered: