Write a program in python to count all palindrome words present in a sentence or string.


For this, we need to loop through each word in the sentence and compare each word with its corresponding reverse. If they are equal then we will increment the count.

In python a word can be easily reversed by word[::-1]

Instead of counting, we will store all the palindrome words in a list, so that it can be printed or used for other purposes.


If you have any suggestions or doubts then comment below.

This Post Has One Comment

  1. Anirudh Kumar

Leave a Reply

2 × five =