Skip to content

Write a Python program to count number of lowercase characters in a string take input from the user

  • by

Use the Input method to take a string from the user. Then user for-loop and check every character lowercase or not.

Python program to count the number of lowercase characters in a string Example

Simple example code to count the number of lowercase characters in a string.

The for loop is used to traverse through the characters in the string.

string = input("Enter string: ")
count = 0
for i in string:
    if i.islower():
        count = count + 1
        
print("Count: ", count)

Output:

Python program to count the number of lowercase characters in a string Example

Do comment if you have any doubts and suggestions on this Python char count program.

Note: IDE: PyCharm 2021.3.3 (Community Edition)

Windows 10

Python 3.10.1

All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.

Leave a Reply

Discover more from Tutorial

Subscribe now to keep reading and get access to the full archive.

Continue reading