I a very new to Python and I am having a hard time understanding why the following code does not work as intended. The idea is for the code to count the vowels in a string, I can get this to work in a different, way but I would like to understand why the following does not work:
s = "tester"
vowelCount = 0
for letters in s:
if letters == "a" or "e" or "i" or "o" or"u":
vowelCount += 1
print("Number of vowels: " + str(vowelCount))
Output: Number of vowels: 6
I've put this throug http://pythontutor.com/ to step through but I am none the wiser. I've had a look into 'Lazy evaluation' but I don't see how this applies to the above code.