All your base

//What is wrong with the following solution for all your base problem
HELP!!!

def toDigits_(s):
# import ipdb; ipdb.set_trace()
if (len(s)) < 3:
return “10”
nl = []
countval = {}
if s[0].isnumeric():
nl.append(s[0])
else:
nl.append(1)
if not s[1].isnumeric():
nl.append(0)
else:
nl.append(s[1])
i = 2
c = 2
while i < len(s):
if s[i].isnumeric():
nl.append(s[i])
else:
if s[i] in countval:
nl.append(countval[s[i]])
else:
countval[s[i]] = c
nl.append(countval[s[i]])
c = c+1
i = i+1
return “”.join(str(el) for el in nl)

def calcVal(s):
val = 0
# import ipdb; ipdb.set_trace()
base = int(max(s)) + 1
for i in range(len(s)):
# print(s[i])
val = val + int(s[i])*(base ** (len(s)-1-i))
return val

def main():
t = int(input())
for i in range(t):
input_str = input()
val = calcVal(toDigits_(input_str))
print(f"Case #{i+1}: {val}")

main()

Better to link to your solution code, especially since you don’t know how to quote code on the discussion board: CodeChef: Practical coding for everyone

You seem to be believing digits in the alien code. The examples in the challenge specifically show that you should not believe that any alien symbol given has a familiar meaning; only that similar symbols have similar meanings (and, conveniently, the aliens are using left-to-right place notation in a fixed base).