Advertisement
Guest User

IDK

a guest
Oct 17th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. def vowels(*args):
  2. if(newstring[i] == 'a' or newstring[i] == 'e' or newstring[i] == 'i' or newstring[i] == 'o' or newstring[i] == 'u' or newstring[i] == 'y' or newstring[i] == 'A' or newstring[i] == 'E' or newstring[i] == 'I' or newstring[i] == 'O' or newstring[i] == 'U' or newstring[i] == 'Y'):
  3. return True
  4. else:
  5. return False
  6.  
  7.  
  8. #Main function
  9. count = 0
  10. newstring = input("Enter the string to get the results from: ")
  11. for i in range(0,len(newstring)):
  12. #Calling in the function
  13. vowels()
  14. if(vowels() == True):
  15. count = count + 1
  16. elif(vowels() == False):
  17. continue
  18. print('Number of vowels in "', newstring, '": ', count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement