(s, base)
return res
Note : You can use int() built-in function instread of this.
        :type s: str
        :type base: int
        :rtype: int
Note : You can use int() built-in function instread of this.
        :type s: str
        :type base: int
        :rtype: int
Note : You can use int () built - in function instread of this . : type s : str : type base : int : rtype : int
def base2int(s, base):
    """
        Note : You can use int() built-in function instread of this.
        :type s: str
        :type base: int
        :rtype: int
    """

    digit = {}
    for i, c in enumerate(string.digits + string.ascii_uppercase):
        digit[c] = i
    multiplier = 1
    res = 0
    for c in s[::-1]:
        res += digit[c] * multiplier
        multiplier *= base
    return res
def base2int ( s , base ) : digit = { } for i , c in enumerate ( string . digits + string . ascii_uppercase ) : digit [ c ] = i multiplier = 1 res = 0 for c in s [ : : - 1 ] : res += digit [ c ] * multiplier multiplier *= base return res