Answer to Question #336113 in Python for Elle Joy

Question #336113

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.

1
Expert's answer
2022-05-01T19:05:49-0400
def is_palindrome(string:str) -> bool:
	
	if string == string[::-1]:
		return True
	return False




print(is_palindrome('notPalindrome'))
print(is_palindrome('palindromemordnilap'))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS