codescracker


python

Python Program to Check Alphabet or Not



« Previous Program Next Program »


Check Alphabet or Not in Python

To check whether the given character is an alphabet or not an alphabet in python, you have to ask from user to enter a character to check for alphabet as shown in the program given here.

Python Programming Code to Check Alphabet or Not

Following python program ask from user to enter any character to check for alphabet:

# Python Program - Check Alphabet or Not
		
while True:
	print("Enter '0' for exit.")
	ch = input("Enter any character: ")
	if ch == '0':
		break
	else:
		if((ch>='a' and ch<='z') or (ch>='A' and ch<='Z')):
			print(ch, "is an alphabet.\n")
		else:
			print(ch, "is not an alphabet.\n")

Here is the sample run of the above Python program shows how to check whether the given character is an alphabet or not:

python check alphabet

Same Program in Other Languages

You may also like to learn or practice the same program in other popular programming languages:


« Previous Program Next Program »




Tools
Calculator

Quick Links
Signup - Login - Give Online Test