I am a beginner at python and am wondering why my code will count the characters in my string rather than the vowels?
I was trying to create a program which would count all of the vowels in my string, but it didn't work
string1 = "This is a string"
vowelCount = 0
for char in string1:
if char in string1 == "a" or "e" or "i" or "o" or "u":
vowelCount += 1
print(vowelCount)
The vowelCount will output as 16 instead of 4 as I intended. How would I be able to fix this issue?