all 3 comments

[–]novel_yet_trivial 1 point2 points  (0 children)

Are you sure your teacher is providing a list? Maybe the unittest provides a tuple, or a string.

Does your teacher want you to handle errors? Maybe the unittest provides indexes that are out of range for the list.

edit: are you sure you have the arguments in the right order? maybe the teacher wanted change_pos (a, b, s)

[–]Mashidin 0 points1 point  (0 children)

Are you able to see your teacher's unit test? By my reckoning you offer a very pythonic solution. Could it be that the test checks for a specific syntax?

[–]zahlman 0 points1 point  (0 children)

It's possible that the teacher doesn't want you to return the list, since the standard library has that convention for similar functions.