i'm making a simple program for school - it should make a list of inputted sentences (which will be input until a sentence that has the the first and last symbol the same), then search for the most used vowel and use it to replace all the other vowels in all the inputted sentences (i haven't got to that part yet). But i have a problem, - i used python tutor for finding what's wrong as i got no error message directly in pyhon, and it seems it just won't let me count things inside lists and the "p" just remains at 0 for the whole time. I can't figure out what's wrong, so any help it appreciated! Sorry if it's just some rookie mistake, i'm quite new to python.
def V(sentence, vowel):
a=0
p=0
b=""
for i in sentence:
for z in i:
if z in vowel:
p=sentence.count(z)
if p>a:
a=p
b=z
return b
sentences=[]
vowels=["a", "e", "i", "o", "u", "y"]
v=input("input a sentence: ")
while v[0]!=v[-1]:
sentences.append(v)
v=input("input a sentence: ")
print("Most used vowel: ", V(sentences, vowels))
a,pandbeach iteration... it'll fairly quickly show you what's up...