How to count Vowels in a String using python

def count_vowels(s):       vowels = 'aeiouAEIOU'count = 0for char

Created By :

Created On :

23-03-2024

How to count Vowels in a String using python

Updated on 24, February 2024 293 Enrolled
how to

Step 1

def count_vowels(s):

      vowels = 'aeiouAEIOU'

count = 0

for char in s:

if char in vowels:

count += 1 return count

string = input("Enter a string: ")

print("Number of vowels:", count_vowels(string))

line

Copyrights © 2024 letsupdateskills All rights reserved