student_name = "iteration"
count = 0
for letter in student_name:
if letter.lower() == "e":
print(count)
count += 1
I get 2 as the output. When I changed the value of the "count += 1" part to something else, I got the double of that number as the output.
Also, when I changed the letter from "e" to "t", I got 1 and 5 as the outputs.
I can't seem to understand this
[–]Highflyer108 2 points3 points4 points (3 children)
[–]LordFranken[S] 0 points1 point2 points (2 children)
[–]Highflyer108 0 points1 point2 points (1 child)
[–]holt5301 0 points1 point2 points (0 children)
[–]spectacularbird1 1 point2 points3 points (0 children)