I need to convert a number to base 10. my input is from this form:1111(the number) 5(on which base) 10(to base).i wrote this code:
s=input()
(number, from_base, to_base) = s.split()
NumList=[number]
NumList.reverse()
i=0
sum=0
while (i< (index.from_base)):
(i,pow(from_base,i),i+1)
sum=sum+i
print (sum)
I want to do: number^the from_base index.I tried also to do i**from_base\i^^from_base. I tried also to add the command NumList.index() but it didn't work.
thank you!