Alphabet or Not program in Python
We can use isalpha() function which is predefined in python.
Input :
enter 56
Output :
56 is not alphabet
Input :
enter f
Output :
f is alphabet
Program to print alphabet or not using Python
#program to print alphabet or not
ch =input("enter ")
#ch.isalpha() is a predefined python fuction to check alphabet or not
if ch.isalpha():
print(ch,"is Alphabet.")
else:
print(ch,"is not Alphabet.")
Output:
enter 56
56 is not Alphabet.
enter f
f is Alphabet.
Comments
Post a Comment
Type Your Comments !
Please do not enter any spam link in the comment box.