Palingrams in python code example
Example: how to find palingrams python
"""
Program:
Python program to find anagrams in a list of strings
"""
from collections import Counter
def get_anagrams(input_string_list, test_string):
print("*******************")
print("input_string_list = ", input_string_list)
print("*******************\n")
out_string_list = list(filter(lambda x: (Counter(test_string) == Counter(x)), input_string_list))
print("*******************")
print("out_string_list = ", out_string_list)
print("*******************\n")
def Driver():
input_string_list = ['Python', 'Program', 'Machine', 'yPtnoh', 'Learning']
test_string = "ntoyPh"
get_anagrams(input_string_list, test_string)
if __name__=="__main__":
Driver()