CJCoding With Joseph
15free / daySign inCreate account

Palindrome Function

Complete is_palindrome(word: str) -> bool so it returns True when the word reads the same backwards and False otherwise. The slice [::-1] gives a reversed copy of a string, and comparing the word with its reversed copy gives the answer directly. The driver reads one word and prints what the function returns; leave it alone. Input: one line, a word in lower case, no prompt.

Expected Output:

True

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
FunctionsSlicing
📥 Auto-Input:
level\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.