Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have a serious indentation problem after the (unnecessary) <code>else: pass</code>. Fix that and try again. Does the problem occur with your sample input data? other data? First time around the loop? What is the value of <code>thisKey</code> that is causing the problem [hint: it's reported in the KeyError error message]? What are the contents of masterDictionary just before the error happens [hint: sprinkle a few <code>print</code> statements around your code]?</p> <p>Other remarks not relevant to your problem:</p> <p>Instead of <code>if thisKey in masterDictionary == False:</code> consider using <code>if thisKey not in masterDictionary:</code> ... comparisons against <code>True</code> or <code>False</code> are almost always redundant and/or a bit of a "code smell".</p> <p>Python convention is to reserve names with an initial capital letter (like <code>Item</code>) for classes.</p> <p>Using only one space per indentation level makes code almost illegible and is severely deprecated. Use 4 always (unless you have a good reason -- but I've never heard of one).</p> <p><strong>Update</strong> I was wrong: <code>thisKey in masterDictionary == False</code> is worse than I thought; because <code>in</code> is a relational operator, chained evaluation is used (like <code>a &lt;= b &lt; c</code>) so you have <code>(thisKey in masterDictionary) and (masterDictionary == False)</code> which will always evaluate to False, and thus the dictionary is never updated. The fix is as I suggested: use <code>if thisKey not in masterDictionary:</code></p> <p>Also it looks like <code>thisList</code> (initialised but not used) should be <code>thisSublist</code> (used but not initialised).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload