I'm a freshman in college, who's taking a python coding class. Currently I'm working on making a program count the amount of vowels or consonants based on a user's input to determine the mode.
currently, I've made two lists, and I'm trying to find out how to program python to count the vowels/consonants.
This is what I have so far - please keep in mind, I've worked on both ends, and the center is where the counting goes.
#=======================================#
#Zane Blalock's Vowel/Consonants Counter#
#=======================================#
print("Welcome to the V/C Counter!")
#Make List
vowels = list("aeiouy")
consonants = list("bcdfghjklmnpqrstvexz")
complete = False
while complete == False:
mode = input("What mode would you like? Vowels or Consonants?: ").lower().strip()
print("")
print("You chose the mode: " + str(mode))
print("")
if mode == "vowels":
word = input("Please input a word: ")
print("your word was: " + str(word))
print("")
choice = input("Are you done, Y/N: ").lower().strip()
if choice == "y":
complete = True
else:
print("Ok, back to the top!")
elif mode == "consonants":
word = input("please input a word: ")
print("your word was: " + str(word))
print("")
choice = input("Are you done, Y/N: ").lower().strip()
if choice == "y":
complete = True
else:
print("Ok, back to the top!")
else:
print("Improper Mode, please input a correct one")
print("Thank you for using this program")
number_of_consonants = sum(word.count(c) for c in consonants)
number_of_vowels = sum(word.count(c) for c in vowels)