Python program to check Digit or Not

ch = input("Please Enter Your Own Character : ")
if(ch >= '0' and ch <= '9'):
    print("The Given Character ", ch, "is a Digit")
else:
    print("The Given Character ", ch, "is Not a Digit")

OUTPUT:

Please Enter Your Own Character : 1
The Given Character  1 is a Digit
>>>
Please Enter Your Own Character : i
The Given Character  i is Not a Digit

Sharing Is Caring

Leave a Comment