title: What is the Big O notation for the str.replace function in Python?
body: <p>What is the big Oh notation for <a href="https://docs.python.org/2/library/stdtypes.html#str.replace" rel="noreferrer"><code>str.replace</code></a> function in Python ?</p>
  
  <p>Is it always O(n) ?</p>
  
  <pre><code>str = "this is string example"
  print str.replace("is", "was")
  </code></pre>
  
  <blockquote>
  <pre><code>thwas was string example
  </code></pre>
  </blockquote>