Python program | Program to take an input and identify input type

"""
The purpose of this program is to take an input and identify the character type
"""
------------------------

#taking input
character = input("Input a character:")

if character.isalpha():
    print("Character is entered")
    
elif character.isdigit():
    print("number is entered")
    
elif character.isspace():
    print("space is entered")

------------------------

Sample Output:

Input a character:7
number is entered

Post a Comment

0 Comments