Computer Science, asked by saadbukharicis, 4 days ago

count consonant letters in python program with user input

Answers

Answered by Anonymous
3

Required python program:

n = input("Enter a string: ")

exception = ("a", "e", "i", "o", "u")

consonants = ""

for i in n:

   if 'a' <= i.lower() <= 'z':

       if not i.lower() in exception:

           consonants += i

print(len(consonants)) 

[For output see the attachment]

Attachments:
Similar questions