title: Python read from file, split each line into different segments, assign to keys
body: <p>So, I'm very new at Python and I'm trying to do a tutorial of making the game Risk very simply where we read in a file and each line has 3 parts: the territory name, numeric id, and continent. So each line in the file would look like this:</p>
  
  <pre><code>Alaska, 11, North America
  France, 15, Europe
  </code></pre>
  
  <p>The dictionary keys are already named "territory", "numeric_id", and "continent". What is the best way to split the line and assign each part to its appropriate key? I haven't seen a question yet about pre-named keys and assigning values to them after splitting a line. Why doesn't this work?</p>
  
  <pre><code>dictionary["territory"], dictionary["numeric_id"], dictionary["continent"] = line
  </code></pre>