Tuesday, 22 September 2026
PastThree rungs, one idea. Solving rung 1 counts. Climb as far as you can.
Backwards Words
strings + building backwards
Turn a word around
Write a function called reverse_word
Return the word with its letters in the opposite order, so "cat" becomes "tac". Build the new word one letter at a time with a loop. An empty word returns an empty word.
Examples
| Input | Output |
|---|---|
| "cat" | "tac" |
| "" | "" |
| "a" | "a" |
| "hello" | "olleh" |
There are extra hidden tests, so make it work in general, not just for these.
Same both ways
Write a function called is_palindrome
A word is a palindrome when it reads the same forwards and backwards, like "noon". Every word is lowercase letters with no spaces. Return True if the word is a palindrome and False if it is not. An empty word counts as a palindrome, so return True for it.
Examples
| Input | Output |
|---|---|
| "noon" | True |
| "cat" | False |
| "" | True |
| "a" | True |
There are extra hidden tests, so make it work in general, not just for these.
The longest one
Write a function called longest_palindrome
words is a list of lowercase words. Return the longest word that reads the same both ways. If two of them are the same length, return the one that comes first in the list. If no word reads the same both ways, and also when the list is empty, return None.
Examples
| Input | Output |
|---|---|
| ["cat", "noon", "level"] | "level" |
| ["cat", "dog"] | None |
| [] | None |
| ["noon", "abba"] | "noon" |
There are extra hidden tests, so make it work in general, not just for these.
Finish Rung 1 and today counts. Rungs 2 and 3 are there if you want to push further.