title: Manipulating sets in dictionaries
body: <p>I need to update a dictionary with the use of sets that I have. My program needs to essentially take a set and assign it to a value (in a dictionary). If the set already exists, i need to update its value (keep adding the values together).</p>
  
  <p>Here is how my program works now:</p>
  
  <pre><code>    for line in fd:
      new_line = line.split(' ')
      for word in new_line:
          new_word = ''.join(l for l in word if l.isalpha())
          new_word = new_word.lower()
          ind_count = 0
          for let in new_word:
              c_dict[let, ind_count] = new_word
              ind_count += 1
  </code></pre>
  
  <p>And in my <code>fd</code> file, it contains a list of words. </p>
  
  <p>I want my result to look something like this:</p>
  
  <pre><code>print(c_dict)
  
  { (0, "h") : { "hello", "helps" } , (0, "c") : { "cow" } }
  </code></pre>
  
  <p>This essentially takes a letter from the word and it's index #, and sets the value to that word. My file will have hundreds of words that have the letter 'h' at position 0, and essentially the key (0, 'h') would have a value that contains all of those words.</p>
  
  <p>Right now, my program just replaces the values. Any help would be greatly appreciated.</p>
  
  <p>Thanks!</p>