In this program, we are going to determine if the given character is Uppercase or Lowercase alphabet using python built-in function isupper[] and islower[].
Function isupper[]
The isupper[] function can be used to check if the character is Uppercase or not. It will return true if the character is Uppercase character.
Function islower[]
The islower[] function is opposite to isupper[], it checks if the character is Lowercase character or not.
Program
# Take input from user ch = input["Enter any character : "][0] # Check for uppercase, lowercase if ch.isupper[] : print["\n" + ch, "is UPPERCASE alphabet."] elif ch.islower[] : print["\n" + ch, "is LOWERCASE alphabet."] else : print["\n" + ch, "is not an alphabet."]
Output
Enter any caracter : k
k is LOWERCASE alphabet.
Python Check whether the given alphabet is upper case or lowercase
Python Check whether the given alphabet is upper case or lowercase
Contents
- 1 Python Check whether the given alphabet is upper case or lowercase
- 1.1 Check whether the given alphabet is in upper or lower using Alphabets
- 1.2 Check whether the given alphabet is in upper or lower using ASCII
- 1.3 Python Check whether the given alphabet is in upper or lower using String function
- 1.4 Related posts:
In this article, we will discuss the concept of the Python Check whether the given alphabet is upper case or lowercase
In this post, we are going to learn how to check the given alphabet is in uppercase or lowercase in Python programming language
Check whether the given alphabet is in upper or lower using Alphabets
The program allows to enter an character, thereafter it checks and displays whether the given alphabet an upper case or lower case in Python language
Program 1
#python program to check Alphabet is Lowercase or Uppercase ch=input["Please enter a character: "] if[ch>='A' and ch='a' and ch=65 and ord[ch]=97 and ord[ch]