Advertisement
Blessing988

Untitled

Feb 11th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. def vowel_count(word):
  2.     vowels=["a", "e", "i", "o", "u"]
  3.     list_of_vowels= [ ]
  4.     word=word.lower( ) #word is automatically converted to lower case if it contains upper cases
  5.     word_list =list(word)
  6.     for i in word_list:
  7.         if i in vowels:
  8.             list_of_vowels.append(i)
  9.     print(len(list_of_vowels))
  10.        
  11.  
  12. vowel_count("INFORMATION")#An example
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement