Challenge 1: Test a String Function — Possible Solution ==================================================================== def is_palindrome(s): return s == s[::-1] def test_is_palindrome_true_case(): assert is_palindrome("racecar") def test_is_palindrome_false_case(): assert not is_palindrome("python") Running: pytest test_palindrome.py Output: test_palindrome.py::test_is_palindrome_true_case PASSED test_palindrome.py::test_is_palindrome_false_case PASSED WHY THIS WORKS AS AN ANSWER ------------------------------ is_palindrome(s) reuses the exact s == s[::-1] logic from Course 1, Chapter 5's own palindrome challenge solution, wrapped in a reusable function this time instead of a one-off script. def test_is_palindrome_true_case(): and def test_is_palindrome_false_case(): both reuse this chapter's test_* naming convention exactly — pytest auto-discovers any function starting with test_ in a test_*.py file, with no manual registration needed, exactly as the chapter describes. assert is_palindrome("racecar") reuses the plain assert keyword from this chapter's opening primer — since is_palindrome("racecar") returns True, the bare assert (equivalent to assert ... == True) passes silently. assert not is_palindrome("python") applies Python's not operator (from Course 1's logical operators) to invert the check — since is_palindrome("python") returns False, not False is True, so this assertion also passes. Two separate test functions are used rather than one, deliberately mirroring the chapter's own test_add_positive_numbers / test_add_negative_numbers pair — each test checks exactly one behavior, so if one case ever breaks, pytest's output reports which specific case failed rather than a single test covering both.