Author terry.reedy
Recipients AjaySyam, steven.daprano, terry.reedy, xtreak
Date 2019-08-31.01:17:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This code derived from the blurry image

lst = ['malaysian', 'malayalam', 'aaaaaaaaa']
ip = input('word ')
li = len(ip)
miss = 0
for word in lst:
    if len(word) == li:
        for j in range(li-1):  # skip last because of lookahead
            if word[j] != ip[j] and word[j+1] != ip[j]:
                 miss += 1
        if miss < li/2:

run with 3.8.0b4 on Win10 in IDLE prints the expected output.

word malayalam

I leave it to you to find out why you got something different and to play with variations. Please direct any questions to python-list or similar forums, as they will almost certainly be off-topic here.  And do follow the advice about question format and providing code as text.

Steven, the code ran without error in PyCharm, but gave no matches.  I presume that the 'error' was not matching 'malaysian' even though the miss count 4 is less than 4.5.  I must have corrected something when reading the blurs and polishing the code.
Date User Action Args
2019-08-31 01:17:43terry.reedysetrecipients: + terry.reedy, steven.daprano, xtreak, AjaySyam
2019-08-31 01:17:42terry.reedysetmessageid: <>
2019-08-31 01:17:42terry.reedylinkissue37988 messages
2019-08-31 01:17:42terry.reedycreate