Skip to content

Write a Python program to input any character and check whether it is alphabet, digit or special character.

PYTHON

Write a Python program to input any character and check whether it is alphabet, digit or special character.

ch = input("Enter the Character :-") if((ch >= 'a' and ch <= 'z') or (ch >= 'A' and ch <= 'Z')): print("It is a alphabet.", ch); elif(ch >= '0' and ch <= '9'): print("It is a digit.", ch); else: print("It is a special character.", ch);

OUTPUT

Leave Your Comment