Elle Joy Vasquez
Preliminary Test 02
Create Python function that checks whether a passed string is PALINDROME or NOT.
Note: A palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.
def is_palindrome(string:str) -> bool:
if string == string[::-1]:
return True
return False
print(is_palindrome('notPalindrome'))
print(is_palindrome('palindromemordnilap'))
Comments
Leave a comment