I'm trying to count the # of vowels and consonants in an inputted string (without punctuation). Currently, my code is not counting the consonants correctly because I don't know how to return 2 different values from one function...storing in a tuple is the way to go?
sentence = str(input("Enter an English sentence: ")).lower()
def vc_counter(sentence):
'''Check how many vowels and consonants are in the sentence'''
VOWELS = ('aeiou')
consonants = ('bcdfghjklmnpqrstvwxyz')
v_count = 0
c_count = 0
for letter in sentence:
letter = letter.strip('.,!')
if letter in VOWELS:
v_count += 1
return v_count
for letter in sentence:
if letter in consonants:
c_count += 1
return c_count
print("Total # of vowels in sentence: ", vc_counter(sentence))
print("Total # of consonants in sentence: ", vc_counter(sentence))