title: How to find same values in dictionary and assign a new item with averaging of duplicate values?
body: <p>I have a text file with movie details,structure like this;</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: center;">ID</th>
  <th style="text-align: center;">Rating</th>
  <th style="text-align: center;">Title</th>
  <th style="text-align: center;">Genre</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: center;">0</td>
  <td style="text-align: center;">4.5</td>
  <td style="text-align: center;">Amelie (Fabuleux destin d'Amélie Poulain, Le) (2001)</td>
  <td style="text-align: center;">Comedy|Romance|Thriller</td>
  </tr>
  <tr>
  <td style="text-align: center;">1</td>
  <td style="text-align: center;">3.0</td>
  <td style="text-align: center;">Die Hard (1988)</td>
  <td style="text-align: center;">Action|Crime|Thriller</td>
  </tr>
  <tr>
  <td style="text-align: center;">2</td>
  <td style="text-align: center;">4.0</td>
  <td style="text-align: center;">Star Wars: Episode VI - Return of the Jedi (1983)</td>
  <td style="text-align: center;">Action|Adventure|Sci-Fi</td>
  </tr>
  <tr>
  <td style="text-align: center;">3</td>
  <td style="text-align: center;">3.5</td>
  <td style="text-align: center;">Fugitive, The (1993)</td>
  <td style="text-align: center;">Thriller</td>
  </tr>
  <tr>
  <td style="text-align: center;">4</td>
  <td style="text-align: center;">4.5</td>
  <td style="text-align: center;">Fugitive, The (1993)</td>
  <td style="text-align: center;">Thriller</td>
  </tr>
  <tr>
  <td style="text-align: center;">5</td>
  <td style="text-align: center;">2.5</td>
  <td style="text-align: center;">Amelie (Fabuleux destin d'Amélie Poulain, Le) (2001)</td>
  <td style="text-align: center;">Comedy|Romance|Thriller</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to find the same movies and save them as a new item by taking the average rating of the movies I found.</p>
  <p>For example;
  Fugitive is duplicated on the list. Average rating: 4.0</p>
  <pre><code>{'580': ['4.0', 'Jurassic Park (1993)', ['Action', 'Adventure', 'Sci-Fi', 'Thriller']], 
   '264': ['4.0', 'Mask, The (1994)', ['Action', 'Comedy', 'Crime', 'Fantasy', 'Thriller']], 
   '370': ['4.5', &quot;Amelie) (2001)&quot;, ['Comedy', 'Romance', 'Thriller']], 
   '312': ['3.0', 'Die Hard (1988)', ['Action', 'Crime', 'Thriller']], 
   '166': ['3.5', 'Fugitive, The (1993)', ['Thriller']], 
   '195': ['4.5', 'Fugitive, The (1993)', ['Thriller']]}
  </code></pre>
  <p>I have saved each line in the file as an item in the dictionary. How can I find and average the same items? Thanks.</p>