word = input('Enter a word\n')
letter = input('Enter a letter\n')
count = 0
for letter in word:
if letter == word[count] :
count = count 1
print(count)
I am trying to count how many times the letter appear in the word. But somehow the count value always equal to the length of the word?
eg. word = try letter = y
the count should be 1 right? but the result is showing 3? I don't understand where the problem is..