Solution

ID: past-exam-of-the-mathematical-and-computational-biology-course-of-the-university-of-cambridge/2025/paper-1/1/a/solution

It tests whether the input string is a palindrome: reversing the characters leaves the string unchanged. Comparisons are case-sensitive and include spaces and punctuation. For example, mystery1("level") returns True, whereas mystery1("lever") returns False.

New to topics? Read the docs here!