Ad
  • Custom User Avatar

    Because the range stop is equal to the length of the input string rather than the length of the input string plus an underline character, and the range step is 2. Suppose you had the even-length string "abcdef" -- no matter how many characters you added to the end of it, with a range stop of 6 and step of 2, i is going to loop through 0, 2, and 4 only.

  • Custom User Avatar

    if if the original string is even, then the added '_' is outside of
    the range we check