How to identify the consonants in string? |String | Python Code.
st=input("Enter your string ")
vowel="aeiouAEIOU"
l1=[]
for i in st:
if(i not in vowel):
l1.append(i)
print("Consonants in given String")
print (l1)
Enter your string hello
Consonants in given String
['h', 'l', 'l']
Comments
Post a Comment