A python code to convert a number from any base to the base of 10 giving errors . What is wrong with this code?
<pre><code>import math 




def baseencode(number, base):
    ##Converting a number of any base to base10

    if number == 0:
        return '0'

    for i in range(0,len(number)):
        if number[i]!= [A-Z]:
            num = num + number[i]*pow(i,base)
        else :
            num = num + (9 + ord(number[i])) *pow(i,base)
    return num

a = baseencode('20',5)
print a 
</code></pre>

<p>Errors I get are </p>

<pre><code>Traceback (most recent call last):
  File "doubtrob.py", line 19, in &lt;module&gt;
    a = baseencode('20',5)
  File "doubtrob.py", line 13, in baseencode
    if number[i]!= [A-Z]:
NameError: global name 'A' is not defined
</code></pre>
