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

+7 votes
asked Feb 18, 2020 by anonymous

1 Answer

+2 votes
answered Jul 22 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 by Peter Minarik (55,660 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.
...