Short answer: size - 1 is used as the end point of the loop, but since range() excludes the end value, it might accidentally skip the last character.
It might seem like you need size - 1 because Python string indexing starts at 0. So if the word has 8 characters, the valid indexes are 0 to 7
But in Python, the range() function already stops before the end value. So if you use range(0, size - 1, 2), you're actually stopping at index 6 (because size - 1 is 7, and range() excludes the end).
That’s why you don’t need to subtract 1 — using range(0, size, 2) is correct. Otherwise, the last character might be skipped.
For example, with input "hello":
range(0, size - 1, 2) gives indexes 0 and 2 → prints h and l
range(0, size, 2) gives indexes 0, 2, and 4 → prints h, l, and o
----------
Also, instead of a loop, you can use slicing:
print("Printing only even index chars:")
print(word[::2])
Example:
Enter a word: hello
Printing only even index chars: hlo
If you want to separate the letters with commas:
print(", ".join(word[::2]))
This would output:
h, l, o