title: combining rows in python which follows some condition
body: <p>I have some list as:  </p>
  
  <pre><code>a=['abc','123','def','ghi','456','jkl','789','mno','pqr']
  </code></pre>
  
  <p>I want to combine the elements of list if the element is number,i.e it contains 0-9<br>
  like:  </p>
  
  <pre><code>b=['abc 123','def','ghi 456','jkl 789','mno','pqr']
  </code></pre>
  
  <p>How to do it? I have a solution if the numeric elements are given as number(like <code>int</code>) but here they are stings.Please help</p>
  
  <p>Suppose if <code>a=['abc',123,'def','ghi',456,'jkl',789,'mno','pqr']</code>
  then we can do:</p>
  
  <pre><code>t=[]
  for i in a:
      if isinstance(i, int):
          t[-1] = "{0} {1}".format(t[-1], i)
      else:
          t.append(i)
  print(t)
  </code></pre>
  
  <p>then output will be :  </p>
  
  <pre><code>t=['abc 123','def','ghi 456','jkl 789','mno','pqr']
  </code></pre>
  
  <p>How to do it for <code>a=['abc','123','def','ghi','456','jkl','789','mno','pqr']</code></p>
  
  <p>Note:If the first element is a number then it should it should stay as it is.
  Also I have such a list that no two numeric elements comes in continuous rows.</p>