Python Program to check character is Lowercase or not

Write a Python program to check character is Lowercase or not using islower() function and ASCII Values 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.

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")
Python Program to check character is Lowercase using islower function

Find character is Lowercase or not using if else

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 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