title: python function to reduce logical operators and operands in a list
body: <p>I have  the following list.</p>
  <pre><code>op=[[3,4,5],'or',[5,6,7],'or',[8,9,10],'and',[9,10,11],'and',[10,11,12]]
  </code></pre>
  <p>This list has lists and operators('and','or') which need to be reduced.</p>
  <p>All the 'and' operations need to be done first finally leaving just the 'or'.
  As follows:
  The list after</p>
  <pre><code>step 1: [[3,4,5],'or',[5,6,7],'or',[8,9,10],'and',[10,11]]
  step 2: [[3,4,5],'or',[5,6,7],'or' ,[10]]
  step 3: [[3,4,5],'or',[5,6,7,10]]
  step 4: [[3,4,5,6,7,10]]
  </code></pre>
  <p>Any help appreciated.</p>
  <p>Thanks,
  Sonia</p>