Iterate through a list of tuple

69 Views Asked by At

i have a list of tuples: tuple_list = [('remarkably','remark'),('prevented','prevent'),...]

I am trying to create a dictionary where the key is the stemmer and the value is the list of words with that stemmer. How do I go about doing this? this is what I have so far and it doesn't seem to be working:

 stem_dict = {}
    for index, tuple in tuple_list:
        if tuple == same_words:
            stem_dict += tuple

i am looking for an output similar to this: output:{‘achiev’: [‘achieved’, ‘achieve’] ‘accident’: [‘accidentally’, ‘accidental’] … }

0

There are 0 best solutions below