Python solution 457


#1
def toNum(self,A):
    return ord(A)-64
    
def titleToNumber(self, A):
    n=len(A)
    sum=0
    for i in range(n):
        sum+= self.toNum(A[i])*26**(n-1-i)
    return sum