Monday, July 27, 2020

Easy Python Program to count Vowels in a name or sentence.[Free Code]

*****
Vowel Counter
*****
import numpy as np
a = input("Enter a word : ")
b = []
v = len(a)
vowels = ['a','e','i','o','u','A','E','I','O','U']
for i in range(v):
if a[i] in vowels:
b.append(a[i])

x = np.array(b)
if len(b)!= 0:
print("THE VOWELS ARE :", b, len(b)," Vowels Found")
print("Unique Vowels are:",np.unique(x))
elif len(b)==0:
print(len(b), " VOWELS FOUND")
else:
print("Unexpected Error")