title: Python nested list replace values
body: <p>My input  looks as below</p>
  <pre><code> txt = ['or', [{'fact': 'name', 'operator': 'equals', 'criteria': 'Network'}]]
  </code></pre>
  <p>code functionaltiy replace any occurence of <strong>equals</strong> in the input with <strong>greater</strong>. Note it can be multiple occurence of the list</p>
  <p>Expected output :</p>
  <p>Output: <code>['or', [{'fact': 'name','operator': 'greater', 'criteria': 'Network'}]]</code></p>
  <p>Tried with the below code :</p>
  <pre><code>result = ' '.join(map(str, txt)).replace(&quot;equals&quot;, &quot;greater&quot;)
  </code></pre>
  <p>which gives <code>or [{'fact': 'name', 'operator': 'greater', 'criteria': 'Network'}]</code>  . How do I join back to the  get original list</p>