{"id":20437,"date":"2021-09-12T12:02:02","date_gmt":"2021-09-12T06:32:02","guid":{"rendered":"https:\/\/python-programs.com\/?p=20437"},"modified":"2021-11-22T18:36:21","modified_gmt":"2021-11-22T13:06:21","slug":"python-program-to-count-number-of-uppercase-letters-in-a-string-using-recursion","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-count-number-of-uppercase-letters-in-a-string-using-recursion\/","title":{"rendered":"Python Program to Count Number of Uppercase Letters in a String using Recursion"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Count Number of Digits in a Number using Recursion<\/a><\/p>\n

Given a string and the task is to count the number of uppercase letters present in a given string using recursion.<\/p>\n

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

Recursion is the process by which a function calls itself directly or indirectly, and the associated function is known as a recursive function. Certain issues can be addressed fairly easily using a recursive approach. Towers of Hanoi (TOH), Inorder \/Preorder\/Postorder Tree Traversals, DFS of Graph, and other analogous issues are examples.<\/p>\n

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

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

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

Given String = \"Hello This is Btechgeeks\"<\/pre>\n

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

The Number Of UpperCase characters Present in the above given String { Hello This is Btechgeeks } = 3<\/pre>\n

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

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

Given String = \"GOOD morning btechgeeks\"<\/pre>\n

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

The Number Of UpperCase characters Present in the above given String { GOOD morning btechgeeks } = 4<\/pre>\n

Program to Count Number of Uppercase Letters in a String using Recursion in Python<\/h2>\n

Below are the ways to count the number of uppercase letters present in a given string using recursion in python:<\/p>\n