Write a python program to print whether the data inputed by the user is a digit , space or and alphabet
Answers
Answered by
0
Answer:
# Take character input from user ch = input("Enter any character : ") # Check for alphabet and digit. if ch[0]. isalpha() : print("\n" + ch[0], "is A ALPHABET.") elif ch[0]. isdigit() : print("\n" + ch[0], "is A DIGIT.") else : print("\n" + ch[0], "is A SPECIAL CHARACTER.")
Answered by
1
# Take character input from user ch = input("Enter any character : ") # Check for alphabet and digit. if ch[0]. isalpha() : print("\n" + ch[0], "is A ALPHABET.") elif ch[0]. isdigit() : print("\n" + ch[0], "is A DIGIT.") else : print("\n" + ch[0], "is A SPECIAL CHARACTER.")
Similar questions
Math,
2 months ago
Math,
2 months ago
Chemistry,
2 months ago
Accountancy,
3 months ago
Chemistry,
3 months ago
English,
11 months ago
Social Sciences,
11 months ago