Python Program to check character is Lowercase or not

Write a Python program to check character is Lowercase or not with a practical example.

Python Program to check character is Lowercase using islower function

In this Python example, we use the islower string function to check whether a given character is lowercase or not.

# Python Program to check character is Lowercase or not
ch = input("Please Enter Your Own Character : ")

if(ch.islower()):
    print("The Given Character ", ch, "is a Lowercase Alphabet")
else:
    print("The Given Character ", ch, "is Not a Lowercase Alphabet")
Please Enter Your Own Character : k
The Given Character  k is a Lowercase Alphabet
>>> 
Please Enter Your Own Character : R
The Given Character  R is Not a Lowercase Alphabet

Python Program to find character is Lowercase or not

This python program allows a user to enter any character. Next, we are using If Else Statement to check whether the user given character is lowercase or not. Here, If statement checks the character is greater than or equal to small a, and less than or equal to z. If it is TRUE, it is lowercase. Otherwise, it is not a lowercase character.

ch = input("Please Enter Your Own Character : ")

if(ch >= 'a' and ch <= 'z'):
    print("The Given Character ", ch, "is a Lowercase Alphabet")
else:
    print("The Given Character ", ch, "is Not a Lowercase Alphabet")
Please Enter Your Own Character : w
The Given Character  w is a Lowercase Alphabet
>>> 
Please Enter Your Own Character : Q
The Given Character  Q is Not a Lowercase Alphabet

Python Program to verify character is Lowercase or not using ASCII Values

In this Python example, we are using ASCII Values to check the character is lowercase or not.

ch = input("Please Enter Your Own Character : ")

if(ord(ch) >= 97 and ord(ch) <= 122):
    print("The Given Character ", ch, "is a Lowercase Alphabet")
else:
    print("The Given Character ", ch, "is Not a Lowercase Alphabet")
Python Program to check character is Lowercase or not 3

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.