Problem: p00017
Buggy submission (Python3, verdict: Wrong Answer):
from sys import stdin

def ascii2num(ascii):
    return ord(ascii) - 96

def num2ascii(num):
    return chr(num + 96)

def slide(word,num):
    return ''.join([num2ascii((ascii2num(ascii) + num) % 26) if ascii != '.' else '.' for ascii in word])

def includekeyword(words):
    for word in words:
        if word in keywords:
            return True
    return False

keywords = ['the', 'this', 'that']


decode = []
for row in stdin:
    words = row.split()
    for num in range(1,27):
        tmp = [slide(word,num) for word in words]
        print (tmp)
        if includekeyword(tmp):
            decode = tmp
            break

Failing test case input:
xlmw mw xli tmgxyvi xlex m orsx mr ilx xwmt.

Expected output:
this is the picture that i knot in eht tsip.


Actual output:
['ymnx', 'nx', 'ymj', 'unhy`wj', 'ymfy', 'n', 'psty', 'ns', 'jmy', 'yxnu.']
['`noy', 'oy', '`nk', 'voi`axk', '`ng`', 'o', 'qtu`', 'ot', 'kn`', '`yov.']
['aop`', 'p`', 'aol', 'wpjabyl', 'aoha', 'p', 'ruva', 'pu', 'loa', 'a`pw.']
['bpqa', 'qa', 'bpm', 'xqkbc`m', 'bpib', 'q', 'svwb', 'qv', 'mpb', 'baqx.']
['cqrb', 'rb', 'cqn', 'yrlcdan', 'cqjc', 'r', 'twxc', 'rw', 'nqc', 'cbry.']
['drsc', 'sc', 'dro', '`smdebo', 'drkd', 's', 'uxyd', 'sx', 'ord', 'dcs`.']
['estd', 'td', 'esp', 'atnefcp', 'esle', 't', 'vy`e', 'ty', 'pse', 'edta.']
['ftue', 'ue', 'ftq', 'buofgdq', 'ftmf', 'u', 'w`af', 'u`', 'qtf', 'feub.']
['guvf', 'vf', 'gur', 'cvpgher', 'gung', 'v', 'xabg', 'va', 'rug', 'gfvc.']
['hvwg', 'wg', 'hvs', 'dwqhifs', 'hvoh', 'w', 'ybch', 'wb', 'svh', 'hgwd.']
['iwxh', 'xh', 'iwt', 'exrijgt', 'iwpi', 'x', '`cdi', 'xc', 'twi', 'ihxe.']
['jxyi', 'yi', 'jxu', 'fysjkhu', 'jxqj', 'y', 'adej', 'yd', 'uxj', 'jiyf.']
['ky`j', '`j', 'kyv', 'g`tkliv', 'kyrk', '`', 'befk', '`e', 'vyk', 'kj`g.']
['l`ak', 'ak', 'l`w', 'haulmjw', 'l`sl', 'a', 'cfgl', 'af', 'w`l', 'lkah.']
['mabl', 'bl', 'max', 'ibvmnkx', 'matm', 'b', 'dghm', 'bg', 'xam', 'mlbi.']
['nbcm', 'cm', 'nby', 'jcwnoly', 'nbun', 'c', 'ehin', 'ch', 'ybn', 'nmcj.']
['ocdn', 'dn', 'oc`', 'kdxopm`', 'ocvo', 'd', 'fijo', 'di', '`co', 'ondk.']
['pdeo', 'eo', 'pda', 'leypqna', 'pdwp', 'e', 'gjkp', 'ej', 'adp', 'poel.']
['qefp', 'fp', 'qeb', 'mf`qrob', 'qexq', 'f', 'hklq', 'fk', 'beq', 'qpfm.']
['rfgq', 'gq', 'rfc', 'ngarspc', 'rfyr', 'g', 'ilmr', 'gl', 'cfr', 'rqgn.']
['sghr', 'hr', 'sgd', 'ohbstqd', 'sg`s', 'h', 'jmns', 'hm', 'dgs', 'srho.']
['this', 'is', 'the', 'picture', 'that', 'i', 'knot', 'in', 'eht', 'tsip.']


Fixed submission (verdict: Accepted):
from sys import stdin

def ascii2num(ascii):
    return ord(ascii) - 96

def num2ascii(num):
    return chr(num + 96)

def slide(word,num):
    return ''.join([num2ascii((ascii2num(ascii) - num) % 26 + 1) if ascii != '.' else '.' for ascii in word])

def includekeyword(words):
    for word in words:
        if word in keywords:
            return True
    return False

keywords = ['the', 'this', 'that']

decode = []
for row in stdin:
    words = row.split()
    for num in range(1,27):
        tmp = [slide(word,num) for word in words]
        if includekeyword(tmp):
            decode = tmp
            print(' '.join(decode))
            break