Answer to Question #237160 in Python for umesh

Question #237160

Letter, Digit or Special Character

You are given a character as input. Check if the given input is a

Lowercase Letter or Uppercase Letter or Digit or a Special Character.Input

The first line of input is a single character

N.Explanation

In the given example character is

9. So, the output should be Digit.


1
Expert's answer
2021-09-14T18:04:17-0400
ch = input()
if len(ch) == 1:
	if ch.isdigit():
		print('Digit')
	elif ch.upper()!=ch:
		print('Lowercase Letter')
	elif ch.lower()!=ch:
		print('Uppercase Letter')
	else:
		print('Special Character')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS