title: What is Big-O of this setitem method?
body: <p>What is time complexity of this <code>__setitem__</code> method for empty dictionary? I think that, .key and .value python methods for dictionary are O(n) ( I read it somewhere) and for loop is also O(n). My guess is O(n)*O(n)*O(n)+O(1) = for loop + if + if body + append. But Im not sure with that "if in for loop body" situation and the .item and .value being O(n).</p>
  
  <p>Please help. It was on my school test. Code is in python.</p>
  
  <pre><code>def __setitem__(self,k,v):
    for item in self._table:
      if k == item._key:
        item._value = v
        return
    self._table.append(self._Item(k,v))
  </code></pre>