Skip to content

Commit 68a43da

Browse files
authored
Fix reference to exercise 5 (#311)
First, check if the array length is greater than 1, and then compare.
1 parent 56e414d commit 68a43da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tutorial/tests/test_11_functional_programming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def test_exercise4(
248248

249249

250250
def reference_exercise5(words: list[str]) -> list[str]:
251-
return list(filter(lambda x: x == x[::-1] and len(x) > 1, words))
251+
return list(filter(lambda x: len(x) > 1 and x == x[::-1], words))
252252

253253

254254
def test_exercise5(function_to_test: Callable[[list[str]], list[str]]):

0 commit comments

Comments
 (0)