Answer to Question #347473 in Python for Tyu

Question #347473

Given a string, write a code to count all palindrome sub string in a given string. Length of palindrome sub string is greater than or equal to 2.





1
Expert's answer
2022-06-06T08:55:02-0400
entered_list = input("Enter a list, separating words with spaces: ").split()
test_list = list(map(str, entered_list))
res = [element for element in test_list if str(element)[::-1] in test_list]
print(len(res))

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