โ ๐ Python World
๐ Palindrome Detector
You can practise without a player, but pick a player to score points!
๐ The mission
Today you unlock
Functions return answers
A function is a tiny machine: it receives inputs, works something out, then returns one answer for the tests to check.
๐ก Hint ladder
- Lowercase it first: word.lower()
- word[::-1] reverses a string โ compare them!
๐งช Coach checks
- โฏ level is one
- โฏ Anna counts too
- โฏ python is not
- โฏ single letter
Live coach
Getting ready
โโโ
๐ฌ Lowercase it, reverse it, compare. == gives True or False directly.
word = "Anna" low = word.lower() print(low) # anna print(low[::-1]) # anna print(low == low[::-1]) # True
๐ It printed:
Nice โ you saw it work!
๐ Output
๐งฉ Gaps filled! Ready to write it all yourself?