• + 1 comment

    My Python code

    def funnyString(s): s2 = s[::-1]

    lst1 = [abs(ord(s[i]) - ord(s[i-1])) for i in range(1, len(s))]
    lst2 = [abs(ord(s2[i]) - ord(s2[i-1])) for i in range(1, len(s2))]
    
    if lst1 == lst2:
        return 'Funny'
    else:
        return 'Not Funny'