Write a program to take input from the user and then check whether it is a number or a character. If it is a character, determine whether it is in uppercase or lowercase.

                                         Write a python program to determine whether a person is eligible to vote.

Write a program to take input from the user and then check whether it is a number or a character. If it is a character, determine whether it is in uppercase or lowercase.

PROGRAM:

a=input("Enter a character:")

if  (a.isalpha() and a.isupper()) :

    print(a,"is a character and it is in upper case.")

elif (a.isalpha() and a.islower()):

    print(a,"is a character and it is in lower case.")

elif (a.isdigit()):

    print(a,"is a number.")

else:

    print("Invalid input.")

OUTPUT:


No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.