How to map alphabet to integer in Python?
<p>I want to get the distance between A and C is 2, what I could think of is using <code>ord</code></p>

<pre><code>ord('C') - ord('A')

#=&gt;2
</code></pre>

<p>Is there a more elegant way to do this?</p>
