Programming Examples

Python program to check character is alphabetic character or not


Write a Python program to  check character is alphabetic character or not

Solution

ch=input("Enter any alphabetic character : ")
if ch>='A' and ch<='Z':
    print("The Character is an upper case letter")
elif ch>='a' and ch<='z':
    print("The Character is an lower case letter")
else:
    print("This is not an alphabetic character!")
Output

Enter any alphabetic character : f

The Character is an lower case letter

>>> 

======================== 

Enter any alphabetic character : R

The Character is an upper case letter

>>> 

======================== 

Enter any alphabetic character : 4

This is not an alphabetic character!

>>> 

======================== 

Enter any alphabetic character : #

This is not an alphabetic character!

>>> 

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad