{"id":15115,"date":"2021-10-01T11:00:34","date_gmt":"2021-10-01T05:30:34","guid":{"rendered":"https:\/\/python-programs.com\/?p=15115"},"modified":"2021-11-22T18:33:26","modified_gmt":"2021-11-22T13:03:26","slug":"python-program-to-count-palindrome-words-in-a-sentence","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-count-palindrome-words-in-a-sentence\/","title":{"rendered":"Python Program to Count Palindrome Words in a Sentence"},"content":{"rendered":"

Don’t miss the chance of Java programs examples with output pdf free download<\/a> as it is very essential for all beginners to experienced programmers for cracking the interviews.<\/p>\n

Given a sentence\/string the task is to count the number of palindromic words in the given string in Python.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Sentence =madam how are you<\/pre>\n

Output:<\/strong><\/p>\n

The total number of palindromic words in the given sentence { madam how are you } are 1<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Sentence = helleh this issi btechgeeksskeeghcetb pyyp<\/pre>\n

Output:<\/strong><\/p>\n

The total number of palindromic words in the given sentence { helleh this issi btechgeeksskeeghcetb pyyp } are  4<\/pre>\n

Program to Count Palindrome Words in a Sentence in Python<\/h2>\n

Below are the ways to Count Palindrome words in the given sentence in Python<\/p>\n