Interview Query

String Palindromes

Start Timer

0:00:00

Upvote
0
Downvote
Save question
Mark as completed
View comments (11)
Next question

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.

Example:

Input:

word1 = "tree"
word2 = "radar"

Output:

def is_palindrome(word1) -> False
def is_palindrome(word2) -> True
.
.
.
.
.


Comments

Loading comments