Hello everyone,
I have a problem with getting the result of my program
.
This is a task on palindromes.
STATEMENT
Write a program which reads a string and prints all palindromes, which can be obtained by removing of some characters of the string. The resulting palindromes do not need to be English words!
Restrictions:
.
If anyone can find the problem and fix it, I appreciate it
.
CODE
I have a problem with getting the result of my program

This is a task on palindromes.
STATEMENT
Write a program which reads a string and prints all palindromes, which can be obtained by removing of some characters of the string. The resulting palindromes do not need to be English words!
Restrictions:
- do not print palindromes of the length 1 (one-letter palindromes)
- each palindrome is printed exactly once

If anyone can find the problem and fix it, I appreciate it

CODE
def check_palin(word): if word==word[::-1]: return True else: return False def all_palindromes(string): result=list() st1="" for i in range(0,len(string)): st1 += string[i] result.append(string[i]) for j in range(i+1,len(string)): st1+=string[j] if check_palin(st1)==True: result.append(st1) st1="" return list(set(result)) w = input("Write any string to find all palindromes: ") all_palindromes(w)