输入单词：apple
生成一个正确的Python程序，将给定单词中的所有字母向前移动两个字符。
def shift_word(word):
        shifted_letter = ""
        for letter in word:
            letter_idx = ord(letter) + 2
            if letter_idx > ord('z'):
                letter_idx -= 26
            shifted_letter += chr(letter_idx)
        return shifted_letter

print(shift_word('apple'))