Interview Query

String Palindromes

Have you seen this question before?

Given a string, write a function to determine if it is palindrome or not.

Note: A palindrome is a word/string that is read the same way forward as it is backward, e.g. 'reviver', 'madam', 'deified' and 'civic' are all palindromes, while 'tree', 'music' and 'person' are not palindromes.



word1 = "tree"
word2 = "radar"


def is_palindrome(word1) -> False
def is_palindrome(word2) -> True
Next question: Meta in an Emerging Market
Python 3.9.6
Loading editor
Use Shift + Enter to run code