title: How to read files with one key but multiple values in Python
body: <p>I am just beginning working with Python and am a little confused. I understand the basic idea of a dictionary as (key, value). I am writing a program and want to read in a file, story it in a dictionary and then complete different functions by referrencing the values. I am not sure if I should use a dictionary or lists. The basic layout of the file is:
  Name followed by 12 different years for example :
  A 12 12 01 11 0 0 2 3 4 9 12 9</p>
  
  <p>I am not sure what the best way to read in this information would be. I was thinking that a dictionary may be helpful if I had Name followed by Years, but I am not sure if I can map 12 years to one key name. I am really confused on how to do this. I can read in the file line by line, but not within the dictionary. </p>
  
  <pre><code>def readInFile():
      fileDict ={"Name ": "Years"}
      with open("names.txt", "r") as f:
          _ = next(f)
          for line in f:
                  if line[1] in fileDict:
                      fileDict[line[0]].append(line[1])
                  else:
                      fileDict[line[0]] = [line[1]]
  </code></pre>
  
  <p>My thinking with this code was to append each year to the value.
  Please let me know if you have any recommendations.</p>
  
  <p>Thank you! </p>