Python - any base to decimal (other2dec)
<p>I failed an exam because of one question. The task is:</p>

<p><em>"Design a program that converts any number from any system to decimal. 
<br/>We confine to the systems in the range from 2 to 22."</em></p>

<p>So there I am. I know the binary[2], octal[8], decimal[10] and hexadecimal[16] systems. There's 1 point for each conversion system, so it has to be a converter:</p>

<p>2->10<br/>
3->10<br/>
...<br/>
22->10<br/></p>

<p>I have no idea how is that possible. I asked my professor after the exam how to do it and he said: "Just x to the power of y, multiply, and there it is. There's the same rule for all of them."</p>

<p>I might be mistaken in what he said because I was in the post-exam state of consciousness. Do you guys have any idea how to solve it?</p>

<p>I see that there were a few questions like that on stackoverflow already, but none of them does not solve the problem the way my professor said. Also, we started learning Python ~4 months ago and we haven't learned some of the options implemented in the replies.</p>

<p>"""IN<br/>
str/int, any base[2-22]<br/>
   OUT<br/>
decimal int or float"""</p>