Function in Python that counts the number of vowels in a string
vowels = []
def vowelscount(string):
if "a" in string:
vowels.append("a")
if "e" in string:
vowels.append("e")
if "i" in string:
vowels.append("i")
if "o" in string:
vowels.append("o")
if "u" in string:
vowels.append("u")
return len(vowels)
print(vowelscount("aeiouaeiou"))
Comments
Post a Comment
Write something to CodeWithAbdur!