I am using python and mysql. Here is my code
cur.execute("SELECT distinct product_type FROM cloth_table")
Product_type_list = cur.fetchall()
Now Product_type_list is a list of strings describing the product_type like this
product_type_list =['T_shirts', 'T_shirt', 'T-shirt', 'Jeans', 'Jean', 'Formal Shirt' 'Shirt']
Here in product_type_list there is a 3 duplicate entry for t-shirt and 2 for each jeans and shirt.
Now i want my Product_type_list to be like this
Product_type_list=['T_shirt' , 'Jeans', 'Shirt']
I think we can use Difflib.Sequencematcher's quickratio. But how to do that