I am trying to write a code with python that will find and count the number of vowels in any given string. My function prints out 0 vowels no matter what. Any tips?
txt = input("Type text: ").lower()
def findVowels():
global txt
vowels = 0
for letter in txt:
if letter == 'aeiouy':
vowels += 1
return vowels
print(findVowels())
Number of vowels = 0 no matter what