From b0a5811aa15a2b854ce9c333c8afa86c29f45f4a Mon Sep 17 00:00:00 2001 From: SoumyaBhattacharjee <52595382+SoumyaBhattacharjee@users.noreply.github.com> Date: Mon, 6 Jan 2020 00:29:26 +0530 Subject: [PATCH] Python code completed --- CheckCharacter.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CheckCharacter.py b/CheckCharacter.py index a507f6b..2260f25 100644 --- a/CheckCharacter.py +++ b/CheckCharacter.py @@ -1,3 +1,21 @@ # A program to check if the a character is a Capital Letter, Small Letter,vowel,consonant, Digit or special Character . ch = input("Enter a character: ") #character input +flag=0 +v=["a","e","i","o","u"] +ch = input("Enter a character: ") +if ch.isupper(): + print("Uppercase Letter") + flag=1 +elif ch.islower(): + print("Lowercase letter") + flag=1 +elif ch.isdigit(): + print("Digit") +else: + print("Special Character") +if flag : + if ch.lower() in v: + print("Character is a vowel") + else: + print("Character is a consonant")