Im unable to count the number of vowels in this program i created. Im unsure why it doesnt work properly
Here is my program
myfile = open("student.txt","r")
ch = ""
vcount = 0
while ch:
ch = myfile.read(1)
if ch in ["a","A","e","E","i","I","o","O","u","U"]:
vcount +=1
print(vcount)
suppose the contents of student.txt was:
Ethan,Jordan,Kevin
im expecting the program to count the vowel so it should print 6. I tried different read methods and different loops but the result wasnt any better