Hi everyone,
I just completed the Chaitana’s Colossal Coaster exercise, and I found the expectations to be a bit misleading.
The exercise is used to introduce the concept of list methods, and some effort is given to teach the distinction between in-place methods such as <list>.sort()
and functions that return a copy of the list such as sorted(<iterable>)
.
In the 6th task of the exercise, the student is asked to:
Define the
sorted_names()
function that takes 1 argument,queue
, (thelist
of people standing in the queue), and returns asorted
copy of thelist
.
The task explicitely asks for the function to return a copy of the list. Yet, sorting the list in-place and returning that list will pass the test cases.
I think it might be confusing for new students, as the test cases do not point out the differences between copying a list or modifying it in-place.
This feeling is strengthened by the fact that tasks that intend to write methods that modify the list in-place (e.g. tasks 3 and 4) also require the methods to return the original list: it might not be perfectly clear to the student that the list has been modified in-place, and that it would be modified even without returning it.
I suggest one of the following:
- Adding test cases that ensure that the functions either modify the lists in-place or not depending on the task expectations (that means that some past solution might not pass these new test cases anymore)
- Modifying the exercise instructions so that each task is intended to modify the lists in-place (not mentioning copies anymore), and adding a global remark that even if these functions return the input lists, the original lists were modified in-place.
I’ll be happy to read your remarks and opinions on this!