Skip to content

TypeScript code snippet – How to get match percentage of lists in python?

res = len(set(test_list1) & set(test_list2)) / float(len(set(test_list1) | set(test_list2))) * 100
# printing result 
print("Percentage similarity among lists is : " + str(res))
See also  CSS code snippet - How to make img cover parent div?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.