title: Python: Find distance between characters of elements of array
body: <p>If I have a list </p>
  
  <pre><code>L = [
  'AXX', 
  'XXX', 
  'XXG'
  ]
  </code></pre>
  
  <p>Suppose it is known that the 'distance' between an <code>A</code> and an adjacent <code>X</code> is 1 and the 'distance' between an <code>A</code> and a diagonally located <code>X</code> is 2. How would I be able to translate that into python?  </p>
  
  <p>Thanks</p>