Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

find multiple palindromes in a word

+9 votes
asked Feb 18, 2020 by anonymous

1 Answer

+2 votes
answered Jul 22, 2022 by anibill (190 points)

# In this program I used regular expression to find a palindrome.
import re
a="good morning madam i am kayak from garag I have a eye pain so i could not level up"

c=re.split("[ ]",a)
print(c)

for i in c:
    if (i==i[::-1] and 1!=len(i)):
        print("{} is a Palindrome  ".format(i))

commented Jul 22, 2022 by Peter Minarik (84,720 points)
Nice solution!
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...