title: Converting a file into a dictionary with one key and multiple values
body: <p>I have a data file that looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/B4Htm.png" alt=""></p>
  
  <p>I want to make the first column into a key and the values that come after the key into values of a dictionary.</p>
  
  <p>This is the code I used but it didn't give me what I wanted.</p>
  
  <pre><code>with open('data.txt', 'r') as f:
      ...: 
      ...:     for line in f:
      ...:         items = line.split()
      ...:         key, values = items[0], items[1:]
      ...:         my_dict[int(key)] = values
  </code></pre>