Answers for "how many vowels in alphabet"

1

count vowels

vow = ['a', 'A', 'e',
          'E', 'i', 'I',
          'o', 'O', 'U',
          'u', 'Y', 'y']

def vowels(str):
  
  global vow
  string = list(str)
  count = 0
  
  for i in range(len(string)):
    
    if string[i] in vow:
      
      count += 1
  return count
Posted by: Guest on October-12-2020
0

How Many Vowels

using System.Linq;
public class Program 
{
    public static int CountVowels(string str)
      => str.Count(a=>$"aeiouAEIOU".Contains(a));
}
Posted by: Guest on July-19-2021

Code answers related to "how many vowels in alphabet"

Python Answers by Framework

Browse Popular Code Answers by Language