Answer to Question #231608 in Python for kaavya

Question #231608

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.

Sample Input 1

9

Sample Output 1

Digit

Sample Input 2

A

Sample Output 2

Uppercase Letter




1
Expert's answer
2021-09-01T23:56:41-0400
n = input('Enter your character here: ')
if n.isalnum() is True:
  if n.isalpha() is True:
    if n.islower() is True:
      print('lower case letter' )
    elif n.isupper() is True:
      print('upper case letter')
  elif n.isnumeric():
    print('digit')
else: 
  print('special character')

Enter your character here: 9
digit

Enter your character here: A
upper case letter

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
APPROVED BY CLIENTS