Write a program to check given character is digit or not using isdigit() method

a = str(input("Enter a digit or character : "))
if a.isdigit():
print("You have entered a digit ")
else:
print(“You have entered a char”)

@mick4mayank

Correct, keep it up.

1 Like