You can download this code by clicking the button below.
This code is now available for download.
This function takes a list of strings as input and returns all unique palindromes in the list.
Technology Stack : strings, lists, functions, sets, filters
Code Type : Function
Code Difficulty : Intermediate
def unique_palindrome_list(string_list):
def is_palindrome(s):
return s == s[::-1]
def get_unique_palindromes(lst):
return list(set(filter(is_palindrome, lst)))
return get_unique_palindromes(string_list)