Python Check Whether The Given Alphabet Is Upper Case Or Lowercase

ch=input("Please enter a character: ")
if(ch>='A' and ch<='Z'):
    print(ch," is an uppercase letter")
elif (ch>='a' and ch<='z'):
    print(ch," is a lowercase letter")
else:
    print(ch," is not in Alphabet")

OUTPUT:

Please enter a character: A
A is an uppercase letter
Please enter a character: x
x is a lowercase letter
Please enter a character: $
$ is not an Alphabets

Leave a Comment