Python abilities on strings
Here's a one liner for you (since the question asks for the minimum number of lines):

encode = lambda s: "".join([(c if (i+1) % 2 == 0 else chr(ord('a') + (ord(c) - ord('a') + i + 1) % 26)) for i, c in enumerate(s)])